mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-22 13:49:54 +07:00
Better naming - constructionComplete -> completeConstruction
This commit is contained in:
@ -35,7 +35,6 @@ import com.unciv.ui.components.extensions.withoutItem
|
||||
import com.unciv.ui.components.fonts.Fonts
|
||||
import com.unciv.ui.screens.civilopediascreen.CivilopediaCategories
|
||||
import com.unciv.ui.screens.civilopediascreen.FormattedLine
|
||||
import com.unciv.ui.screens.worldscreen.WorldScreen
|
||||
import kotlin.math.ceil
|
||||
import kotlin.math.min
|
||||
import kotlin.math.roundToInt
|
||||
@ -338,7 +337,7 @@ class CityConstructions : IsPartOfGameInfoSerialization {
|
||||
if (inProgressConstructions.containsKey(currentConstructionFromQueue)
|
||||
&& inProgressConstructions[currentConstructionFromQueue]!! >= productionCost) {
|
||||
val potentialOverflow = inProgressConstructions[currentConstructionFromQueue]!! - productionCost
|
||||
if (constructionComplete(construction)) {
|
||||
if (completeConstruction(construction)) {
|
||||
// See the URL below for explanation for this cap
|
||||
// https://forums.civfanatics.com/threads/hammer-overflow.419352/
|
||||
val maxOverflow = maxOf(productionCost, city.cityStats.currentCityStats.production.roundToInt())
|
||||
@ -458,7 +457,7 @@ class CityConstructions : IsPartOfGameInfoSerialization {
|
||||
}
|
||||
|
||||
/** Returns false if we tried to construct a unit but it has nowhere to go */
|
||||
fun constructionComplete(construction: INonPerpetualConstruction): Boolean {
|
||||
fun completeConstruction(construction: INonPerpetualConstruction): Boolean {
|
||||
val managedToConstruct = construction.postBuildEvent(this)
|
||||
if (!managedToConstruct) return false
|
||||
|
||||
|
@ -119,7 +119,7 @@ class CivConstructions : IsPartOfGameInfoSerialization {
|
||||
|
||||
freeStatBuildingsProvided.addToMapOfSets(stat.name, city.id)
|
||||
addFreeBuilding(city.id, building.name)
|
||||
city.cityConstructions.constructionComplete(building)
|
||||
city.cityConstructions.completeConstruction(building)
|
||||
}
|
||||
}
|
||||
|
||||
@ -142,7 +142,7 @@ class CivConstructions : IsPartOfGameInfoSerialization {
|
||||
|
||||
freeSpecificBuildingsProvided.addToMapOfSets(building.name, city.id)
|
||||
addFreeBuilding(city.id, building.name)
|
||||
city.cityConstructions.constructionComplete(building)
|
||||
city.cityConstructions.completeConstruction(building)
|
||||
}
|
||||
}
|
||||
|
||||
@ -162,12 +162,12 @@ class CivConstructions : IsPartOfGameInfoSerialization {
|
||||
city.cityConstructions.freeBuildingsProvidedFromThisCity.addToMapOfSets(city.id, freeBuilding.name)
|
||||
|
||||
if (city.cityConstructions.containsBuildingOrEquivalent(freeBuilding.name)) continue
|
||||
city.cityConstructions.constructionComplete(freeBuilding)
|
||||
city.cityConstructions.completeConstruction(freeBuilding)
|
||||
}
|
||||
|
||||
for (building in autoGrantedBuildings)
|
||||
if (building.isBuildable(city.cityConstructions))
|
||||
city.cityConstructions.constructionComplete(building)
|
||||
city.cityConstructions.completeConstruction(building)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -71,7 +71,6 @@ class Unique(val text: String, val sourceObjectType: UniqueTarget? = null, val s
|
||||
private fun getUniqueMultiplier(stateForConditionals: StateForConditionals = StateForConditionals()): Int {
|
||||
val forEveryConditionals = conditionals.filter { it.type == UniqueType.ForEveryCountable }
|
||||
val forEveryAmountConditionals = conditionals.filter { it.type == UniqueType.ForEveryAmountCountable }
|
||||
if (forEveryConditionals.isEmpty() && forEveryAmountConditionals.isEmpty()) return 1
|
||||
var amount = 1
|
||||
for (conditional in forEveryConditionals) { // multiple multipliers DO multiply.
|
||||
val multiplier = Countables.getCountableAmount(conditional.params[0], stateForConditionals)
|
||||
|
@ -886,7 +886,7 @@ object UniqueTriggerActivation {
|
||||
applicableCity.cityConstructions.freeBuildingsProvidedFromThisCity.addToMapOfSets(applicableCity.id, freeBuilding.name)
|
||||
|
||||
if (applicableCity.cityConstructions.containsBuildingOrEquivalent(freeBuilding.name)) continue
|
||||
applicableCity.cityConstructions.constructionComplete(freeBuilding)
|
||||
applicableCity.cityConstructions.completeConstruction(freeBuilding)
|
||||
}
|
||||
true
|
||||
}
|
||||
|
Reference in New Issue
Block a user