mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-25 21:03:15 -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() }
|
||||
|
||||
@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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user