Tiny optimization for isCoastalTile (#2434)
Yes benefit may be low as neighbors are already cached, but cost is negligible
This commit is contained in:
parent
31134d0fe5
commit
ac8648216e
1 changed files with 3 additions and 1 deletions
|
@ -292,7 +292,9 @@ open class TileInfo {
|
|||
|
||||
fun hasImprovementInProgress() = improvementInProgress!=null
|
||||
|
||||
fun isCoastalTile() = neighbors.any { it.baseTerrain==Constants.coast }
|
||||
@delegate:Transient
|
||||
private val _isCoastalTile: Boolean by lazy { neighbors.any { it.baseTerrain==Constants.coast } }
|
||||
fun isCoastalTile() = _isCoastalTile
|
||||
|
||||
fun hasViewableResource(civInfo: CivilizationInfo): Boolean =
|
||||
resource != null && (getTileResource().revealedBy == null || civInfo.tech.isResearched(getTileResource().revealedBy!!))
|
||||
|
|
Loading…
Reference in a new issue