[Freeciv-Dev] Re: (PR#12930) RFC: generalizing output types in effects
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://bugs.freeciv.org/Ticket/Display.html?id=12930 >
Benoit Hudson wrote:
> Do we need more than 2-d? It wouldn't be hard to go for 3, but I can't
> think why we would want to.
We have one 3d effect: EFT_XXX_BONUS and EFT_XXX_BONUS_2.
> We could also use just one function, at the cost of some checking:
> get_city_bonus(const struct city *pcity, enum effect_type, ...)
> a la fcntl. This may be a bad idea, I'm not sure.
>
> I'm not sure why this solution is particularly complicated, as compared
> to the making the output type a requirement (which is... interesting).
When the requirement solution occurred to me, I immediately rejected it.
The output type isn't a requirement, it's a parameter! But as I kept
looking a the other situations where this comes up (specialist bonuses,
unit bonuses) I realized that this distinction is very blurry.
Consider (simplified registry format):
[effect_factory]
name = "Output_Bonus", "Shield"
reqs = {
"Building", "Factory"
}
[effect_factory]
name = "Output_bonus"
reqs = {
"Building", "Factory"
"Output_Type", "Shield"
}
you'd probably say the first one makes a lot more sense. But now consider:
[effect_libraries_make_scientists_smarter]
name = "OUTPUT_INC_SPECIALIST", "Science", "Scientist"
reqs = {
"Building", "Library"
}
[effect_libraries_make_scientists_smarter]
name = "OUTPUT_INC_SPECIALIST", "Science"
reqs = {
"Building", "Library"
"Specialist", "Scientist"
}
[effect_libraries_make_scientists_smarter]
name = "OUTPUT_INC_SPECIALIST", "Scientist"
reqs = {
"Building", "Library"
"Output_Type", "Science"
}
[effect_libraries_make_scientists_smarter]
name = "OUTPUT_INC_SPECIALIST"
reqs = {
"Building", "Library"
"Specialist", "Scientist"
"Output_Type", "Science"
}
is there one of these forms that is preferred? And what about:
[effect_magellans]
name = "MOVE", "Sea"
reqs = {
"Building", "Magellan's"
}
[effect_magellans]
name = "MOVE"
reqs = {
"Building", "Magellan's"
"UnitClass", "Sea"
}
is there a preferred form here?
-jason
|
|