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 { object BuildConfig {
const val kotlinVersion = "1.3.71" const val kotlinVersion = "1.3.71"
const val appName = "Unciv" const val appName = "Unciv"
const val appCodeNumber = 495 const val appCodeNumber = 496
const val appVersion = "3.11.10" const val appVersion = "3.11.10-patch1"
const val gdxVersion = "1.9.12" const val gdxVersion = "1.9.12"
const val roboVMVersion = "2.3.1" const val roboVMVersion = "2.3.1"

View File

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

View File

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