3.11.10-patch1

This commit is contained in:
Yair Morgenstern 2020-11-08 23:39:05 +02:00
parent 4667594731
commit e3fc967216
3 changed files with 7 additions and 4 deletions

View File

@ -3,8 +3,8 @@ package com.unciv.build
object BuildConfig {
const val kotlinVersion = "1.3.71"
const val appName = "Unciv"
const val appCodeNumber = 495
const val appVersion = "3.11.10"
const val appCodeNumber = 496
const val appVersion = "3.11.10-patch1"
const val gdxVersion = "1.9.12"
const val roboVMVersion = "2.3.1"

View File

@ -128,6 +128,7 @@ class ConstructionAutomation(val cityConstructions: CityConstructions){
bfs.nextStep()
if (tilesThatNeedWorkboat.any { bfs.hasReachedTile(it) })
break
if (bfs.hasEnded()) break
}
if (tilesThatNeedWorkboat.none { bfs.hasReachedTile(it) }) return

View File

@ -18,13 +18,13 @@ class BFS(val startingPoint: TileInfo, val predicate : (TileInfo) -> Boolean) {
}
fun stepToEnd() {
while (tilesToCheck.isNotEmpty())
while (!hasEnded())
nextStep()
}
fun stepUntilDestination(destination: TileInfo): BFS {
while (!tilesReached.containsKey(destination) && tilesToCheck.isNotEmpty())
while (!tilesReached.containsKey(destination) && !hasEnded())
nextStep()
return this
}
@ -52,6 +52,8 @@ class BFS(val startingPoint: TileInfo, val predicate : (TileInfo) -> Boolean) {
return path
}
fun hasEnded() = tilesToCheck.isEmpty()
fun hasReachedTile(tile: TileInfo) =
tilesReached.containsKey(tile)
}