mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-25 12:54:06 -04:00
chore: code linting
This commit is contained in:
parent
2dfeb4a142
commit
66b6be5858
@ -45,9 +45,7 @@ class TileLayerCityButton(tileGroup: TileGroup, size: Float) : TileLayer(tileGro
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun doUpdate(viewingCiv: Civilization?, localUniqueCache: LocalUniqueCache) {
|
override fun doUpdate(viewingCiv: Civilization?, localUniqueCache: LocalUniqueCache) {
|
||||||
|
if (tileGroup !is WorldTileGroup) return
|
||||||
if (tileGroup !is WorldTileGroup)
|
|
||||||
return
|
|
||||||
|
|
||||||
val city = tile().getCity()
|
val city = tile().getCity()
|
||||||
|
|
||||||
@ -57,21 +55,16 @@ class TileLayerCityButton(tileGroup: TileGroup, size: Float) : TileLayer(tileGro
|
|||||||
cityButton = null
|
cityButton = null
|
||||||
}
|
}
|
||||||
|
|
||||||
if (viewingCiv == null)
|
if (viewingCiv == null) return
|
||||||
return
|
if (city == null || !tileGroup.tile.isCityCenter()) return
|
||||||
|
|
||||||
val tileIsViewable = isViewable(viewingCiv)
|
|
||||||
val shouldShow = DebugUtils.VISIBLE_MAP
|
|
||||||
|
|
||||||
// Create (if not yet) and update city button
|
// Create (if not yet) and update city button
|
||||||
if (city != null && tileGroup.tile.isCityCenter()) {
|
if (cityButton == null) {
|
||||||
if (cityButton == null) {
|
cityButton = CityButton(city, tileGroup)
|
||||||
cityButton = CityButton(city, tileGroup)
|
addActor(cityButton)
|
||||||
addActor(cityButton)
|
|
||||||
}
|
|
||||||
|
|
||||||
cityButton!!.update(shouldShow || tileIsViewable)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cityButton!!.update(DebugUtils.VISIBLE_MAP || isViewable(viewingCiv))
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user