mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-30 07:21:34 -04:00
Linting
This commit is contained in:
parent
8e900a2503
commit
20cf0c9203
@ -168,12 +168,10 @@ class ConstructionsTable(val cityScreen: CityScreen) : Table(CameraStageBaseScre
|
||||
val specialConstructions = ArrayList<Table>()
|
||||
|
||||
thread {
|
||||
|
||||
val constructionButtonDTOList = getConstructionButtonDTOs() // Since this can be a heavy operation and leads to many ANRs on older phones...
|
||||
// Since this can be a heavy operation and leads to many ANRs on older phones we put the metadata-gathering in another thread.
|
||||
val constructionButtonDTOList = getConstructionButtonDTOs()
|
||||
Gdx.app.postRunnable {
|
||||
// For some bizarre reason, moving this to another thread messes up the entire construction list?! Haven't figured out why yet
|
||||
availableConstructionsTable.clear()
|
||||
|
||||
for (dto in constructionButtonDTOList) {
|
||||
val constructionButton = getConstructionButton(dto)
|
||||
when (dto.construction) {
|
||||
|
@ -112,8 +112,10 @@ class WorldMapHolder(internal val worldScreen: WorldScreen, internal val tileMap
|
||||
|
||||
if (previousSelectedUnits.isNotEmpty() && previousSelectedUnits.any { it.getTile() != tileInfo }
|
||||
&& worldScreen.isPlayersTurn
|
||||
&& previousSelectedUnits.any { it.movement.canMoveTo(tileInfo) ||
|
||||
it.movement.isUnknownTileWeShouldAssumeToBePassable(tileInfo)}) {
|
||||
&& previousSelectedUnits.any {
|
||||
it.movement.canMoveTo(tileInfo) ||
|
||||
it.movement.isUnknownTileWeShouldAssumeToBePassable(tileInfo)
|
||||
}) {
|
||||
// this can take a long time, because of the unit-to-tile calculation needed, so we put it in a different thread
|
||||
addTileOverlaysWithUnitMovement(previousSelectedUnits, tileInfo)
|
||||
} else addTileOverlays(tileInfo) // no unit movement but display the units in the tile etc.
|
||||
@ -387,15 +389,15 @@ class WorldMapHolder(internal val worldScreen: WorldScreen, internal val tileMap
|
||||
val attackableTiles: List<AttackableTile> = if (unit.type.isCivilian()) listOf()
|
||||
else {
|
||||
BattleHelper.getAttackableEnemies(unit, unit.movement.getDistanceToTiles())
|
||||
.filter { (UncivGame.Current.viewEntireMapForDebug ||
|
||||
playerViewableTilePositions.contains(it.tileToAttack.position)) }
|
||||
.filter {
|
||||
(UncivGame.Current.viewEntireMapForDebug ||
|
||||
playerViewableTilePositions.contains(it.tileToAttack.position))
|
||||
}
|
||||
.distinctBy { it.tileToAttack }
|
||||
}
|
||||
|
||||
for (attackableTile in attackableTiles) {
|
||||
|
||||
tileGroups[attackableTile.tileToAttack]!!.showCircle(colorFromRGB(237, 41, 57))
|
||||
|
||||
tileGroups[attackableTile.tileToAttack]!!.showCrosshair(
|
||||
// the targets which cannot be attacked without movements shown as orange-ish
|
||||
if (attackableTile.tileToAttackFrom != unit.currentTile)
|
||||
@ -489,6 +491,7 @@ class WorldMapHolder(internal val worldScreen: WorldScreen, internal val tileMap
|
||||
}
|
||||
|
||||
// For debugging purposes
|
||||
override fun draw(batch: Batch?, parentAlpha: Float) { super.draw(batch, parentAlpha) }
|
||||
override fun act(delta: Float) { super.act(delta) }
|
||||
override fun draw(batch: Batch?, parentAlpha: Float) = super.draw(batch, parentAlpha)
|
||||
|
||||
override fun act(delta: Float) = super.act(delta)
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user