From bad6692207ac85c4221a4724d6256e4f9e23d9bc Mon Sep 17 00:00:00 2001 From: yairm210 Date: Thu, 4 Nov 2021 22:40:26 +0200 Subject: [PATCH] Deprecated older fields --- .../logic/civilization/CivConstructions.kt | 37 ------------------- .../logic/civilization/CivilizationInfo.kt | 8 ---- .../unciv/logic/civilization/PolicyManager.kt | 12 ------ .../logic/civilization/ReligionManager.kt | 13 ------- 4 files changed, 70 deletions(-) diff --git a/core/src/com/unciv/logic/civilization/CivConstructions.kt b/core/src/com/unciv/logic/civilization/CivConstructions.kt index adcc02d8a3..a5b257e8ea 100644 --- a/core/src/com/unciv/logic/civilization/CivConstructions.kt +++ b/core/src/com/unciv/logic/civilization/CivConstructions.kt @@ -45,43 +45,6 @@ class CivConstructions { fun setTransients(civInfo: CivilizationInfo) { this.civInfo = civInfo - - // civInfo.boughtConstructionsWithGloballyIncreasingPrice deprecated since 3.16.15, this is replacement code - if (civInfo.boughtConstructionsWithGloballyIncreasingPrice.isNotEmpty()) { - for (item in civInfo.boughtConstructionsWithGloballyIncreasingPrice) { - boughtItemsWithIncreasingPrice.add(item.key, item.value) - } - civInfo.boughtConstructionsWithGloballyIncreasingPrice.clear() - } - // - - // Deprecated variables in civ.policies since 3.16.15, this is replacement code - if (civInfo.policies.specificBuildingsAdded.isNotEmpty()) { - for ((building, cities) in civInfo.policies.specificBuildingsAdded) { - for (cityId in cities) { - if (building !in freeSpecificBuildingsProvided) - freeSpecificBuildingsProvided[building] = hashSetOf() - freeSpecificBuildingsProvided[building]!!.add(cityId) - - if (cityId !in freeBuildings) - freeBuildings[cityId] = hashSetOf() - freeBuildings[cityId]!!.add(building) - } - } - civInfo.policies.specificBuildingsAdded.clear() - } - - if (civInfo.policies.cultureBuildingsAdded.isNotEmpty()) { - for ((cityId, building) in civInfo.policies.cultureBuildingsAdded) { - freeStatBuildingsProvided[Stat.Culture.name]!!.add(cityId) - - if (cityId !in freeBuildings) - freeBuildings[cityId] = hashSetOf() - freeBuildings[cityId]!!.add(building) - } - civInfo.policies.cultureBuildingsAdded.clear() - } - // } fun startTurn() { diff --git a/core/src/com/unciv/logic/civilization/CivilizationInfo.kt b/core/src/com/unciv/logic/civilization/CivilizationInfo.kt index 273e6e5136..89b3749cf8 100644 --- a/core/src/com/unciv/logic/civilization/CivilizationInfo.kt +++ b/core/src/com/unciv/logic/civilization/CivilizationInfo.kt @@ -148,11 +148,6 @@ class CivilizationInfo { */ val temporaryUniques = ArrayList>() - /** Maps the name of the construction to the amount of times bought */ - @Deprecated("Deprecated since 3.16.15", replaceWith = ReplaceWith("civWideConstructions.boughtItemsWithIncreasingPrice")) - val boughtConstructionsWithGloballyIncreasingPrice = HashMap() - - // if we only use lists, and change the list each time the cities are changed, // we won't get concurrent modification exceptions. // This is basically a way to ensure our lists are immutable. @@ -228,9 +223,6 @@ class CivilizationInfo { toReturn.cityStateUniqueUnit = cityStateUniqueUnit toReturn.flagsCountdown.putAll(flagsCountdown) toReturn.temporaryUniques.addAll(temporaryUniques) - // Deprecated since 3.16.15 - toReturn.boughtConstructionsWithGloballyIncreasingPrice.putAll(boughtConstructionsWithGloballyIncreasingPrice) - // toReturn.hasEverOwnedOriginalCapital = hasEverOwnedOriginalCapital toReturn.passableImpassables.addAll(passableImpassables) toReturn.numMinorCivsAttacked = numMinorCivsAttacked diff --git a/core/src/com/unciv/logic/civilization/PolicyManager.kt b/core/src/com/unciv/logic/civilization/PolicyManager.kt index 98937e9ec3..cfd0ca10b9 100644 --- a/core/src/com/unciv/logic/civilization/PolicyManager.kt +++ b/core/src/com/unciv/logic/civilization/PolicyManager.kt @@ -28,13 +28,6 @@ class PolicyManager { var shouldOpenPolicyPicker = false get() = field && canAdoptPolicy() - // Deprecated since 3.16.15 - @Deprecated("Deprecated since 3.16.15", ReplaceWith("civInfo.civWideConstructions.freeStatBuildingsProvided[Stat.Culture]")) - var cultureBuildingsAdded = HashMap() // Maps cities to buildings - @Deprecated("Deprecated since 3.16.15", ReplaceWith("civInfo.civWideConstructions.freeSpecificBuildingsProvided")) - var specificBuildingsAdded = HashMap>() // Maps buildings to cities - // - fun clone(): PolicyManager { val toReturn = PolicyManager() @@ -43,11 +36,6 @@ class PolicyManager { toReturn.freePolicies = freePolicies toReturn.shouldOpenPolicyPicker = shouldOpenPolicyPicker toReturn.storedCulture = storedCulture - // Deprecated since 3.16.15 - toReturn.cultureBuildingsAdded.putAll(cultureBuildingsAdded) - toReturn.specificBuildingsAdded.putAll(specificBuildingsAdded) - // - return toReturn } diff --git a/core/src/com/unciv/logic/civilization/ReligionManager.kt b/core/src/com/unciv/logic/civilization/ReligionManager.kt index e3422f6ad9..7b550c3d26 100644 --- a/core/src/com/unciv/logic/civilization/ReligionManager.kt +++ b/core/src/com/unciv/logic/civilization/ReligionManager.kt @@ -28,12 +28,6 @@ class ReligionManager { // But the other one should still be _somewhere_. So our only option is to have the GameInfo // contain the master list, and the ReligionManagers retrieve it from there every time the game loads. - // Deprecated since 3.16.13 - @Deprecated("Replace by adding to `civInfo.civWideConstructions.boughtItemsWithIncreasingPrice`") - var greatProphetsEarned = 0 - private set - // - var religionState = ReligionState.None private set @@ -65,13 +59,6 @@ class ReligionManager { religion = civInfo.gameInfo.religions.values.firstOrNull { it.foundingCivName == civInfo.civName } - - // greatProphetsEarned deprecated since 3.16.13, replacement code - if (greatProphetsEarned != 0) { - civInfo.civConstructions.boughtItemsWithIncreasingPrice[getGreatProphetEquivalent()!!] = greatProphetsEarned - greatProphetsEarned = 0 - } - // } fun startTurn() {