New feature: Rework of the city name manager
- New method of entering names that requires less effort*, automatically making sure the inverse naming direction always exists
- Moved communist names and era based renames to dictionaries
- Communist renames are now checked when adopting new civics instead of when a tech is discovered
- Added a method to reverse communist names when Central Planning is abandoned
- General cleanup of the code
*to elaborate, this means that every city is now uniquely identified by one specific out of all of its possible names. For instance, Constantinople is always identified as "Constantinopolis". If you want to add a new name for the city for a language, you always only have to use this identifier (e.g. English only has to add "Constantinopolis -> Constantinople", but not e.g. "Konstantinoupolis -> Constantinople"). To make this work, you have to separately register the new rename as a possible name for the identifier "Constantinopolis" in a separate identifiers dictionary.
This helps in two ways: since you don't have to manually enter every possible name yourself, pairs cannot be missed and missing renames much less likely to happen. Secondly, it cuts down on the overall file size and amount of work to maintain it significantly.
Previously, the worst offender, Constantinople, had 19 possible names. To cover all possible renames, you had to manually enter all 18^2 = 324 combinations. Now only up to 2 * 19 entries are required. Likewise, entering a new name would only require at most 2 new entries instead of 19. People who are familiar with the many-to-many problem should be familiar with this phenomenon.
The reason the CNM file is not significantly shorter than before is because it now covers a lot of inverse renames that were previously missing at no extra space required.
I used an automated script to convert most of the renames to the new format. It's not entirely perfect, so some renames might have been missed. If so, please report missing renames in the thread I will create for this purpose.