GameInfo

class GameInfo

Types

YearsToTurn
Link copied to clipboard
private class YearsToTurn(toTurn: Int, yearInterval: Float)

Functions

addBombardNotification
Link copied to clipboard
private fun addBombardNotification(thisPlayer: CivilizationInfo, cities: List<CityInfo>)
addEnemyUnitNotification
Link copied to clipboard
private fun addEnemyUnitNotification(thisPlayer: CivilizationInfo, tiles: List<TileInfo>, inOrNear: String)
asPreview
Link copied to clipboard
fun asPreview(): GameInfoPreview
clone
Link copied to clipboard
fun clone(): GameInfo
equals
Link copied to clipboard
open operator fun equals(other: Any?): Boolean
getAliveCityStates
Link copied to clipboard
fun getAliveCityStates(): List<CivilizationInfo>
getAliveMajorCivs
Link copied to clipboard
fun getAliveMajorCivs(): List<CivilizationInfo>
getBarbarianCivilization
Link copied to clipboard
fun getBarbarianCivilization(): CivilizationInfo

Get barbarian civ

getCities
Link copied to clipboard
fun getCities(): Sequence<CityInfo>
getCivilization
Link copied to clipboard
fun getCivilization(civName: String): CivilizationInfo

Get a civ by name

getCivilizationsAsPreviews
Link copied to clipboard
getCurrentPlayerCivilization
Link copied to clipboard
fun getCurrentPlayerCivilization(): CivilizationInfo
getDifficulty
Link copied to clipboard
fun getDifficulty(): Difficulty
getEquivalentTurn
Link copied to clipboard
private fun getEquivalentTurn(): Int
getPlayerToViewAs
Link copied to clipboard
fun getPlayerToViewAs(): CivilizationInfo
getSpectator
Link copied to clipboard
fun getSpectator(playerId: String): CivilizationInfo

Returns the first spectator for a playerId or creates one if none found

getYear
Link copied to clipboard
fun getYear(turnOffset: Int = 0): Int
hashCode
Link copied to clipboard
open fun hashCode(): Int
isReligionEnabled
Link copied to clipboard
fun isReligionEnabled(): Boolean
nextTurn
Link copied to clipboard
fun nextTurn()
notifyExploredResources
Link copied to clipboard
fun notifyExploredResources(civInfo: CivilizationInfo, resourceName: String, maxDistance: Int, showForeign: Boolean)
notifyOfCloseEnemyUnits
Link copied to clipboard
private fun notifyOfCloseEnemyUnits(thisPlayer: CivilizationInfo)
setTransients
Link copied to clipboard
fun setTransients()
toString
Link copied to clipboard
open fun toString(): String

Properties

barbarians
Link copied to clipboard
var barbarians: BarbarianManager
civilizations
Link copied to clipboard
var civilizations: MutableList<CivilizationInfo>
currentPlayer
Link copied to clipboard
var currentPlayer: String
currentPlayerCiv
Link copied to clipboard
lateinit var currentPlayerCiv: CivilizationInfo
currentTurnStartTime
Link copied to clipboard
var currentTurnStartTime: Long = 0L
customSaveLocation
Link copied to clipboard
var customSaveLocation: String? = null

Keep track of a custom location this game was saved to or loaded from

difficulty
Link copied to clipboard
var difficulty: String
difficultyObject
Link copied to clipboard
lateinit var difficultyObject: Difficulty
diplomaticVictoryVotesCast
Link copied to clipboard
var diplomaticVictoryVotesCast: HashMap<String, String>
gameId
Link copied to clipboard
var gameId: String
gameParameters
Link copied to clipboard
var gameParameters: GameParameters
isUpToDate
Link copied to clipboard
var isUpToDate: Boolean = false

This is used in multiplayer games, where I may have a saved game state on my phone that is inconsistent with the saved game on the cloud

oneMoreTurnMode
Link copied to clipboard
var oneMoreTurnMode: Boolean = false
religions
Link copied to clipboard
var religions: HashMap<String, Religion>
ruleSet
Link copied to clipboard
lateinit var ruleSet: Ruleset
simulateMaxTurns
Link copied to clipboard
var simulateMaxTurns: Int = 1000

Simulate until any player wins, or turns exceeds indicated number Does not update World View until finished. Should be set manually on each new game start.

simulateUntilWin
Link copied to clipboard
var simulateUntilWin: Boolean = false
spaceResources
Link copied to clipboard
var spaceResources: HashSet<String>
tileMap
Link copied to clipboard
var tileMap: TileMap
turns
Link copied to clipboard
var turns: Int = 0

Extensions

removeMissingModReferences
Link copied to clipboard
fun GameInfo.removeMissingModReferences()

Mods can change, leading to things on the map that are no longer defined in the mod. This function removes them so the game doesn't crash when it tries to access them.

replaceDiplomacyFlag
Link copied to clipboard
fun GameInfo.replaceDiplomacyFlag(old: DiplomacyFlags, new: DiplomacyFlags)

Replace a deprecated DiplomacyFlags instance

Sources

jvm source
Link copied to clipboard