CityConstructionsTable

class CityConstructionsTable(cityScreen: CityScreen)

Manager to hold and coordinate two widgets for the city screen left side:

  • Construction queue with switch to ConstructionInfoTable button and the enqueue / buy buttons. The queue is scrollable, limited to one third of the stage height.

  • Available constructions display, scrolling, grouped with expanders and therefore of dynamic height.

Constructors

CityConstructionsTable
Link copied to clipboard
fun CityConstructionsTable(cityScreen: CityScreen)

Types

ConstructionButtonDTO
Link copied to clipboard
private class ConstructionButtonDTO(construction: IConstruction, buttonText: String, rejectionReason: String?)

Functions

addActorsToStage
Link copied to clipboard
fun addActorsToStage()
addCategory
Link copied to clipboard
private fun Table.addCategory(title: String, list: ArrayList<Table>, prefWidth: Float)
addConstructionToQueue
Link copied to clipboard
private fun addConstructionToQueue(construction: IConstruction, cityConstructions: CityConstructions)
askToBuyConstruction
Link copied to clipboard
fun askToBuyConstruction(construction: INonPerpetualConstruction, stat: Stat = preferredBuyStat)

Ask whether user wants to buy construction for stat.

cannotAddConstructionToQueue
Link copied to clipboard
private fun cannotAddConstructionToQueue(construction: IConstruction, city: CityInfo, cityConstructions: CityConstructions): Boolean
equals
Link copied to clipboard
open operator fun equals(other: Any?): Boolean
getBuyButton
Link copied to clipboard
private fun getBuyButton(construction: INonPerpetualConstruction?, stat: Stat = Stat.Gold): TextButton?
getBuyButtons
Link copied to clipboard
private fun getBuyButtons(construction: INonPerpetualConstruction?): List<TextButton>
getConstructionButton
Link copied to clipboard
private fun getConstructionButton(constructionButtonDTO: CityConstructionsTable.ConstructionButtonDTO): Table
getConstructionButtonDTOs
Link copied to clipboard
getConstructionSound
Link copied to clipboard
private fun getConstructionSound(construction: IConstruction): UncivSound
getHeader
Link copied to clipboard
private fun getHeader(title: String): Table
getLowerPriorityButton
Link copied to clipboard
private fun getLowerPriorityButton(constructionQueueIndex: Int, name: String, city: CityInfo): Table
getLowerWidth
Link copied to clipboard
fun getLowerWidth(): Float

Forces layout calculation and returns the lower Table's (available constructions) width

getProgressBar
Link copied to clipboard
private fun getProgressBar(constructionName: String): Group
getQueueButton
Link copied to clipboard
private fun getQueueButton(construction: IConstruction?): TextButton
getQueueEntry
Link copied to clipboard
private fun getQueueEntry(constructionQueueIndex: Int, constructionName: String): Table
getRaisePriorityButton
Link copied to clipboard
private fun getRaisePriorityButton(constructionQueueIndex: Int, name: String, city: CityInfo): Table
getRemoveFromQueueButton
Link copied to clipboard
private fun getRemoveFromQueueButton(constructionQueueIndex: Int, city: CityInfo): Table
getUpperWidth
Link copied to clipboard
fun getUpperWidth(): Float

Forces layout calculation and returns the upper Table's (construction queue) width

hashCode
Link copied to clipboard
open fun hashCode(): Int
isConstructionPurchaseAllowed
Link copied to clipboard
private fun isConstructionPurchaseAllowed(construction: INonPerpetualConstruction, stat: Stat, constructionBuyCost: Int): Boolean

This tests whether the buy button should be enabled

isConstructionPurchaseShown
Link copied to clipboard
private fun isConstructionPurchaseShown(construction: INonPerpetualConstruction, stat: Stat): Boolean

This tests whether the buy button should be shown

isSelectedQueueEntry
Link copied to clipboard
private fun isSelectedQueueEntry(): Boolean
purchaseConstruction
Link copied to clipboard
private fun purchaseConstruction(construction: INonPerpetualConstruction, stat: Stat = Stat.Gold)
resizeAvailableConstructionsScrollPane
Link copied to clipboard
private fun resizeAvailableConstructionsScrollPane()
toString
Link copied to clipboard
open fun toString(): String
update
Link copied to clipboard
fun update(selectedConstruction: IConstruction?)
updateAvailableConstructions
Link copied to clipboard
private fun updateAvailableConstructions()
updateButtons
Link copied to clipboard
private fun updateButtons(construction: IConstruction?)
updateConstructionQueue
Link copied to clipboard
private fun updateConstructionQueue()

Properties

availableConstructionsScrollPane
Link copied to clipboard
private val availableConstructionsScrollPane: AutoScrollPane
availableConstructionsTable
Link copied to clipboard
private val availableConstructionsTable: Table
buyButtonsTable
Link copied to clipboard
private val buyButtonsTable: Table
cityScreen
Link copied to clipboard
private val cityScreen: CityScreen
constructionsQueueScrollPane
Link copied to clipboard
private val constructionsQueueScrollPane: AutoScrollPane
constructionsQueueTable
Link copied to clipboard
private val constructionsQueueTable: Table
improvementBuildingToConstruct
Link copied to clipboard
var improvementBuildingToConstruct: Building? = null
isVisible
Link copied to clipboard
var isVisible: Boolean

Gets or sets visibility of both widgets

lowerTable
Link copied to clipboard
private val lowerTable: Table
lowerTableScrollCell
Link copied to clipboard
private val lowerTableScrollCell: Cell<AutoScrollPane>
pad
Link copied to clipboard
private val pad: Float = 10f
posFromEdge
Link copied to clipboard
private val posFromEdge: Float
preferredBuyStat
Link copied to clipboard
private var preferredBuyStat: Stat
selectedQueueEntry
Link copied to clipboard
private var selectedQueueEntry: Int
showCityInfoTableButton
Link copied to clipboard
private val showCityInfoTableButton: TextButton
stageHeight
Link copied to clipboard
private val stageHeight: Float
upperTable
Link copied to clipboard
private val upperTable: Table

Sources

jvm source
Link copied to clipboard