mirror of
https://github.com/yairm210/Unciv.git
synced 2025-03-03 22:22:51 +07:00
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
@ -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 New Issue
Block a user