mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-24 20:31:51 -04:00
chore: More civinfo cleanup
This commit is contained in:
parent
a5a50a30e1
commit
1b497c6941
@ -30,7 +30,6 @@ import com.unciv.logic.map.MapUnit
|
|||||||
import com.unciv.logic.map.TileInfo
|
import com.unciv.logic.map.TileInfo
|
||||||
import com.unciv.logic.map.UnitMovementAlgorithms
|
import com.unciv.logic.map.UnitMovementAlgorithms
|
||||||
import com.unciv.logic.trade.TradeRequest
|
import com.unciv.logic.trade.TradeRequest
|
||||||
import com.unciv.models.Counter
|
|
||||||
import com.unciv.models.ruleset.Building
|
import com.unciv.models.ruleset.Building
|
||||||
import com.unciv.models.ruleset.Policy
|
import com.unciv.models.ruleset.Policy
|
||||||
import com.unciv.models.ruleset.Victory
|
import com.unciv.models.ruleset.Victory
|
||||||
@ -954,12 +953,6 @@ class CivilizationInfo : IsPartOfGameInfoSerialization {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getGreatPersonPointsForNextTurn(): Counter<String> {
|
|
||||||
val greatPersonPoints = Counter<String>()
|
|
||||||
for (city in cities) greatPersonPoints.add(city.getGreatPersonPoints())
|
|
||||||
return greatPersonPoints
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @returns whether units of this civilization can pass through the tiles owned by [otherCiv],
|
* @returns whether units of this civilization can pass through the tiles owned by [otherCiv],
|
||||||
* considering only civ-wide filters.
|
* considering only civ-wide filters.
|
||||||
|
@ -59,8 +59,8 @@ class GreatPersonManager : IsPartOfGameInfoSerialization {
|
|||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
fun addGreatPersonPoints(greatPersonPointsForTurn: Counter<String>) {
|
fun addGreatPersonPoints() {
|
||||||
greatPersonPointsCounter.add(greatPersonPointsForTurn)
|
greatPersonPointsCounter.add(getGreatPersonPointsForNextTurn())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -73,4 +73,10 @@ class GreatPersonManager : IsPartOfGameInfoSerialization {
|
|||||||
else greatPeople.toHashSet()
|
else greatPeople.toHashSet()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun getGreatPersonPointsForNextTurn(): Counter<String> {
|
||||||
|
val greatPersonPoints = Counter<String>()
|
||||||
|
for (city in civInfo.cities) greatPersonPoints.add(city.getGreatPersonPoints())
|
||||||
|
return greatPersonPoints
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -249,8 +249,8 @@ class TurnManager(val civInfo: CivilizationInfo) {
|
|||||||
|
|
||||||
civInfo.espionageManager.endTurn()
|
civInfo.espionageManager.endTurn()
|
||||||
|
|
||||||
if (civInfo.isMajorCiv())
|
if (civInfo.isMajorCiv()) // City-states don't get great people!
|
||||||
civInfo.greatPeople.addGreatPersonPoints(civInfo.getGreatPersonPointsForNextTurn()) // City-states don't get great people!
|
civInfo.greatPeople.addGreatPersonPoints()
|
||||||
|
|
||||||
// To handle tile's owner issue (#8246), we need to run being razed city first.
|
// To handle tile's owner issue (#8246), we need to run being razed city first.
|
||||||
for (city in sequence {
|
for (city in sequence {
|
||||||
|
@ -158,7 +158,7 @@ class StatsOverviewTab(
|
|||||||
add("Points per turn".toLabel()).row()
|
add("Points per turn".toLabel()).row()
|
||||||
|
|
||||||
val greatPersonPoints = viewingPlayer.greatPeople.greatPersonPointsCounter
|
val greatPersonPoints = viewingPlayer.greatPeople.greatPersonPointsCounter
|
||||||
val greatPersonPointsPerTurn = viewingPlayer.getGreatPersonPointsForNextTurn()
|
val greatPersonPointsPerTurn = viewingPlayer.greatPeople.getGreatPersonPointsForNextTurn()
|
||||||
val pointsToGreatPerson = viewingPlayer.greatPeople.getPointsRequiredForGreatPerson()
|
val pointsToGreatPerson = viewingPlayer.greatPeople.getPointsRequiredForGreatPerson()
|
||||||
for ((greatPerson, points) in greatPersonPoints) {
|
for ((greatPerson, points) in greatPersonPoints) {
|
||||||
add(greatPerson.toLabel()).left()
|
add(greatPerson.toLabel()).left()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user