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