mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-21 13:18:56 +07:00
chore: More civinfo cleanup
This commit is contained in:
@ -30,7 +30,6 @@ import com.unciv.logic.map.MapUnit
|
||||
import com.unciv.logic.map.TileInfo
|
||||
import com.unciv.logic.map.UnitMovementAlgorithms
|
||||
import com.unciv.logic.trade.TradeRequest
|
||||
import com.unciv.models.Counter
|
||||
import com.unciv.models.ruleset.Building
|
||||
import com.unciv.models.ruleset.Policy
|
||||
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],
|
||||
* considering only civ-wide filters.
|
||||
|
@ -59,8 +59,8 @@ class GreatPersonManager : IsPartOfGameInfoSerialization {
|
||||
return null
|
||||
}
|
||||
|
||||
fun addGreatPersonPoints(greatPersonPointsForTurn: Counter<String>) {
|
||||
greatPersonPointsCounter.add(greatPersonPointsForTurn)
|
||||
fun addGreatPersonPoints() {
|
||||
greatPersonPointsCounter.add(getGreatPersonPointsForNextTurn())
|
||||
}
|
||||
|
||||
|
||||
@ -73,4 +73,10 @@ class GreatPersonManager : IsPartOfGameInfoSerialization {
|
||||
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()
|
||||
|
||||
if (civInfo.isMajorCiv())
|
||||
civInfo.greatPeople.addGreatPersonPoints(civInfo.getGreatPersonPointsForNextTurn()) // City-states don't get great people!
|
||||
if (civInfo.isMajorCiv()) // 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.
|
||||
for (city in sequence {
|
||||
|
@ -158,7 +158,7 @@ class StatsOverviewTab(
|
||||
add("Points per turn".toLabel()).row()
|
||||
|
||||
val greatPersonPoints = viewingPlayer.greatPeople.greatPersonPointsCounter
|
||||
val greatPersonPointsPerTurn = viewingPlayer.getGreatPersonPointsForNextTurn()
|
||||
val greatPersonPointsPerTurn = viewingPlayer.greatPeople.getGreatPersonPointsForNextTurn()
|
||||
val pointsToGreatPerson = viewingPlayer.greatPeople.getPointsRequiredForGreatPerson()
|
||||
for ((greatPerson, points) in greatPersonPoints) {
|
||||
add(greatPerson.toLabel()).left()
|
||||
|
Reference in New Issue
Block a user