mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-21 13:18:56 +07:00
Don't allocate memory until you have to
This commit is contained in:
@ -366,8 +366,8 @@ class Tile : IsPartOfGameInfoSerialization, Json.Serializable {
|
||||
|
||||
fun isRoughTerrain() = allTerrains.any { it.isRough() }
|
||||
|
||||
@Transient
|
||||
private val stateThisTile: StateForConditionals = StateForConditionals(tile = this)
|
||||
@delegate:Transient
|
||||
private val stateThisTile: StateForConditionals by lazy { StateForConditionals(tile = this) }
|
||||
/** Checks whether any of the TERRAINS of this tile has a certain unique */
|
||||
fun terrainHasUnique(uniqueType: UniqueType, state: StateForConditionals = stateThisTile) =
|
||||
terrainUniqueMap.getMatchingUniques(uniqueType, state).any()
|
||||
|
Reference in New Issue
Block a user