mirror of
https://github.com/yairm210/Unciv.git
synced 2024-12-22 23:04:25 +07: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) {
|
||||
|
||||
if (tileGroup !is WorldTileGroup)
|
||||
return
|
||||
if (tileGroup !is WorldTileGroup) return
|
||||
|
||||
val city = tile().getCity()
|
||||
|
||||
@ -57,21 +55,16 @@ class TileLayerCityButton(tileGroup: TileGroup, size: Float) : TileLayer(tileGro
|
||||
cityButton = null
|
||||
}
|
||||
|
||||
if (viewingCiv == null)
|
||||
return
|
||||
|
||||
val tileIsViewable = isViewable(viewingCiv)
|
||||
val shouldShow = DebugUtils.VISIBLE_MAP
|
||||
|
||||
if (viewingCiv == null) return
|
||||
if (city == null || !tileGroup.tile.isCityCenter()) return
|
||||
|
||||
// Create (if not yet) and update city button
|
||||
if (city != null && tileGroup.tile.isCityCenter()) {
|
||||
if (cityButton == null) {
|
||||
cityButton = CityButton(city, tileGroup)
|
||||
addActor(cityButton)
|
||||
}
|
||||
|
||||
cityButton!!.update(shouldShow || tileIsViewable)
|
||||
if (cityButton == null) {
|
||||
cityButton = CityButton(city, tileGroup)
|
||||
addActor(cityButton)
|
||||
}
|
||||
|
||||
cityButton!!.update(DebugUtils.VISIBLE_MAP || isViewable(viewingCiv))
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user