BackwardCompatibility
object BackwardCompatibility
Content copied to clipboard
Container for all temporarily used code managing transitions from deprecated elements to their replacements.
Please place all such code here and call it only from GameInfo.setTransients. Functions are allowed to remain once no longer used if you think they might serve as template for similar usecases in the future. Please comment sufficiently :)
Functions
changeBuildingNameIfNotInRuleset
Link copied to clipboard
private fun changeBuildingNameIfNotInRuleset(ruleSet: Ruleset, cityConstructions: CityConstructions, oldBuildingName: String, newBuildingName: String)
Content copied to clipboard
Replaces all occurrences of oldBuildingName in cityConstructions with newBuildingName if the former is not contained in the ruleset.
removeMissingModReferences
Link copied to clipboard
Mods can change, leading to things on the map that are no longer defined in the mod. This function removes them so the game doesn't crash when it tries to access them.
replaceDiplomacyFlag
Link copied to clipboard
fun GameInfo.replaceDiplomacyFlag(old: DiplomacyFlags, new: DiplomacyFlags)
Content copied to clipboard
Replace a deprecated DiplomacyFlags instance
replaceUpdatedTechName
Link copied to clipboard
private fun TechManager.replaceUpdatedTechName(oldTechName: String, newTechName: String)
Content copied to clipboard
Replace a changed tech name
Sources
jvm source
Link copied to clipboard