This commit splits some of the functionality of the gamemap object
into a new class, the "terrain_type_data" object. This class is
intended to hold a record of known terrains and the terrain code ->
terrain type map. It handles merging in new terrain definitions,
and it is shared between map objects. It is also cached by the game
config manager, so that we only recalculate this data when we
change configs.
There is in fact a *semantic* change going on here, which is that
when a scenario introduces a new terrain type by merging, this gets
added to the global cache. The alternative is to make a copy of the
global cache, only for the this scenario, as soon as we have to
dirty the cache. However since I didn't see any downside to putting
the merged terrains together and carrying them across scenarios,
I opted not to do that here.
This function required the use of resources::game_map, so properly
should be a method of game_map. This will help us to make sure that
such functions work when using either the editor or the play
controller, or the replay controller, and generally improve
encapsulation.
If we decided it was worth it to inline map_location ==, then
surely this is also worth it to inline null_location, as the
compiler may be able to reduce tests for == null location to
"x == ... && y == ...", without having to move to a different
compilation unit.
(This new translatable string is only visible/useful for wml authors,
and we have lots on untranslated wml error messages anyway; also
they really don't need to be translatable)
The changes are guarded by the C++ and WML conditional symbol
"EXPERIMENTAL".
The experimental flag is temporarily defaulted off, so those patches
should have no effect on people doing ordinary builds. This may change
once fendrin has the tunnel code fixed and polished.
If present, these override the name attribute for the "outside"
portion of the human-readable terrain description, e.g. the part not
in parentheses.
The main use for this is editor palette tooltips; they now say, for
example, "Summer Deciduous Forest (Forest)". I've also wired things
so that the normal in-game terrain report uses description rather than
name when it's available, as a demonstration (that's the diff to
generate.report.cpp) but it might be that level of detail is not
actually desirable in the game itself.