Clarify/optimize the role of the inProgressConstructions validator (#2433)
This commit is contained in:
parent
3f7d5a5cb4
commit
bc6e2c97ef
1 changed files with 5 additions and 0 deletions
|
@ -238,6 +238,7 @@ class CityConstructions {
|
|||
|
||||
fun endTurn(cityStats: Stats) {
|
||||
validateConstructionQueue()
|
||||
validateInProgressConstructions()
|
||||
|
||||
if(getConstruction(currentConstructionFromQueue) !is PerpetualConstruction)
|
||||
addProductionPoints(cityStats.production.roundToInt())
|
||||
|
@ -252,8 +253,12 @@ class CityConstructions {
|
|||
if (getConstruction(construction).isBuildable(this))
|
||||
constructionQueue.add(construction)
|
||||
}
|
||||
}
|
||||
|
||||
private fun validateInProgressConstructions() {
|
||||
// remove obsolete stuff from in progress constructions - happens often and leaves clutter in memory and save files
|
||||
// should have NO visible consequences - any accumulated points that may be reused later should stay (nukes when manhattan project city lost, nat wonder when conquered an empty city...)
|
||||
// Needs only be called once in a while - endTurn is enough
|
||||
val inProgressSnapshot = inProgressConstructions.keys.filter { it != currentConstructionFromQueue }
|
||||
for (constructionName in inProgressSnapshot) {
|
||||
val rejectionReason: String =
|
||||
|
|
Loading…
Reference in a new issue