mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-26 21:35:14 -04:00
Deprecated older fields
This commit is contained in:
parent
eb24a8d364
commit
bad6692207
@ -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() {
|
||||
|
@ -148,11 +148,6 @@ class CivilizationInfo {
|
||||
*/
|
||||
val temporaryUniques = ArrayList<Pair<Unique, Int>>()
|
||||
|
||||
/** 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<String, Int>()
|
||||
|
||||
|
||||
// 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
|
||||
|
@ -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<String, String>() // Maps cities to buildings
|
||||
@Deprecated("Deprecated since 3.16.15", ReplaceWith("civInfo.civWideConstructions.freeSpecificBuildingsProvided"))
|
||||
var specificBuildingsAdded = HashMap<String, MutableSet<String>>() // 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
|
||||
}
|
||||
|
||||
|
@ -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() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user