CityConstructions

class CityConstructions

City constructions manager.

Constructors

CityConstructions
Link copied to clipboard
fun CityConstructions()

Functions

addBuilding
Link copied to clipboard
fun addBuilding(buildingName: String)
addCheapestBuildableStatBuilding
Link copied to clipboard
fun addCheapestBuildableStatBuilding(stat: Stat): String?
addFreeBuildings
Link copied to clipboard
fun addFreeBuildings()
addProductionPoints
Link copied to clipboard
fun addProductionPoints(productionToAdd: Int)
addToQueue
Link copied to clipboard
fun addToQueue(constructionName: String)
chooseNextConstruction
Link copied to clipboard
fun chooseNextConstruction()
clone
Link copied to clipboard
fun clone(): CityConstructions
constructIfEnough
Link copied to clipboard
fun constructIfEnough()
constructionBegun
Link copied to clipboard
private fun constructionBegun(construction: IConstruction)
constructionComplete
Link copied to clipboard
private fun constructionComplete(construction: INonPerpetualConstruction)
containsBuildingOrEquivalent
Link copied to clipboard
fun containsBuildingOrEquivalent(building: String): Boolean
endTurn
Link copied to clipboard
fun endTurn(cityStats: Stats)
equals
Link copied to clipboard
open operator fun equals(other: Any?): Boolean
getBasicStatBuildings
Link copied to clipboard
fun getBasicStatBuildings(stat: Stat): Sequence<Building>
getBuildableBuildings
Link copied to clipboard
internal fun getBuildableBuildings(): Sequence<Building>
getBuiltBuildings
Link copied to clipboard
internal fun getBuiltBuildings(): Sequence<Building>
getCityProductionTextForCityButton
Link copied to clipboard
fun getCityProductionTextForCityButton(): String
getConstructableUnits
Link copied to clipboard
fun getConstructableUnits(): Sequence<BaseUnit>
getConstruction
Link copied to clipboard
internal fun getConstruction(constructionName: String): IConstruction
getCurrentConstruction
Link copied to clipboard
fun getCurrentConstruction(): IConstruction
getMaintenanceCosts
Link copied to clipboard
fun getMaintenanceCosts(): Int
getProductionMarkup
Link copied to clipboard
fun getProductionMarkup(ruleset: Ruleset): FormattedLine
getRemainingWork
Link copied to clipboard
fun getRemainingWork(constructionName: String, useStoredProduction: Boolean = true): Int
getStatPercentBonuses
Link copied to clipboard
fun getStatPercentBonuses(): Stats
getStats
Link copied to clipboard
fun getStats(): Stats
getTurnsToConstructionString
Link copied to clipboard
internal fun getTurnsToConstructionString(constructionName: String, useStoredProduction: Boolean = true): String
getWorkDone
Link copied to clipboard
fun getWorkDone(constructionName: String): Int
hasBuildableStatBuildings
Link copied to clipboard
fun hasBuildableStatBuildings(stat: Stat): Boolean
hashCode
Link copied to clipboard
open fun hashCode(): Int
isBeingConstructed
Link copied to clipboard
fun isBeingConstructed(constructionName: String): Boolean
isBeingConstructedOrEnqueued
Link copied to clipboard
fun isBeingConstructedOrEnqueued(constructionName: String): Boolean
isBuildingWonder
Link copied to clipboard
fun isBuildingWonder(): Boolean
isBuilt
Link copied to clipboard
fun isBuilt(buildingName: String): Boolean
isEnqueued
Link copied to clipboard
fun isEnqueued(constructionName: String): Boolean
isFirstConstructionOfItsKind
Link copied to clipboard
fun isFirstConstructionOfItsKind(constructionQueueIndex: Int, name: String): Boolean

If the city is constructing multiple units of the same type, subsequent units will require the full cost

isQueueFull
Link copied to clipboard
fun isQueueFull(): Boolean
lowerPriority
Link copied to clipboard
fun lowerPriority(constructionQueueIndex: Int)
purchaseConstruction
Link copied to clipboard
fun purchaseConstruction(constructionName: String, queuePosition: Int, automatic: Boolean, stat: Stat = Stat.Gold): Boolean

Purchase a construction for gold called from NextTurnAutomation and the City UI Build / place the new item, deduct cost, and maintain queue.

raisePriority
Link copied to clipboard
fun raisePriority(constructionQueueIndex: Int)
removeBuilding
Link copied to clipboard
fun removeBuilding(buildingName: String)
removeCurrentConstruction
Link copied to clipboard
private fun removeCurrentConstruction()
removeFromQueue
Link copied to clipboard
fun removeFromQueue(constructionQueueIndex: Int, automatic: Boolean)

If this was done automatically, we should automatically try to choose a new construction and treat it as such

setTransients
Link copied to clipboard
fun setTransients()
swap
Link copied to clipboard
private fun MutableList<String>.swap(idx1: Int, idx2: Int)
toString
Link copied to clipboard
open fun toString(): String
turnsToConstruction
Link copied to clipboard
fun turnsToConstruction(constructionName: String, useStoredProduction: Boolean = true): Int
updateUniques
Link copied to clipboard
fun updateUniques()
validateConstructionQueue
Link copied to clipboard
private fun validateConstructionQueue()
validateInProgressConstructions
Link copied to clipboard
private fun validateInProgressConstructions()

Properties

builtBuildingObjects
Link copied to clipboard
private var builtBuildingObjects: ArrayList<Building>
builtBuildings
Link copied to clipboard
var builtBuildings: HashSet<String>
builtBuildingUniqueMap
Link copied to clipboard
val builtBuildingUniqueMap: UniqueMap
cityInfo
Link copied to clipboard
lateinit var cityInfo: CityInfo

the city it refers to

constructionQueue
Link copied to clipboard
var constructionQueue: MutableList<String>

a list of constructions names enqueued

currentConstructionFromQueue
Link copied to clipboard
var currentConstructionFromQueue: String

name of the construction that is currently being produced

currentConstructionIsUserSet
Link copied to clipboard
var currentConstructionIsUserSet: Boolean = false

a flag indicating if the currentConstructionFromQueue has been set by the user or by the AI

freeBuildingsProvidedFromThisCity
Link copied to clipboard
inProgressConstructions
Link copied to clipboard
val inProgressConstructions: HashMap<String, Int>
productionOverflow
Link copied to clipboard
var productionOverflow: Int = 0
queueMaxSize
Link copied to clipboard
val queueMaxSize: Int = 10

Sources

jvm source
Link copied to clipboard