mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-26 15:49:14 +07:00
Resolved #2536 - cities correctly expand to the last available tile
This commit is contained in:
@ -26,7 +26,6 @@ class CityExpansionManager {
|
|||||||
.map { it.position }
|
.map { it.position }
|
||||||
return cityInfo.tiles.count { it != cityInfo.location && it !in tilesAroundCity}
|
return cityInfo.tiles.count { it != cityInfo.location && it !in tilesAroundCity}
|
||||||
}
|
}
|
||||||
fun isAreaMaxed(): Boolean = cityInfo.tiles.size >= 90
|
|
||||||
|
|
||||||
// This one has conflicting sources -
|
// This one has conflicting sources -
|
||||||
// http://civilization.wikia.com/wiki/Mathematics_of_Civilization_V says it's 20+(10(t-1))^1.1
|
// http://civilization.wikia.com/wiki/Mathematics_of_Civilization_V says it's 20+(10(t-1))^1.1
|
||||||
@ -98,10 +97,6 @@ class CityExpansionManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun addNewTileWithCulture(): Boolean {
|
private fun addNewTileWithCulture(): Boolean {
|
||||||
if (isAreaMaxed()) {
|
|
||||||
cultureStored = 0
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
val chosenTile = chooseNewTileToOwn()
|
val chosenTile = chooseNewTileToOwn()
|
||||||
if (chosenTile != null) {
|
if (chosenTile != null) {
|
||||||
cultureStored -= getCultureToNextTile()
|
cultureStored -= getCultureToNextTile()
|
||||||
|
@ -60,7 +60,7 @@ class CityStatsTable(val cityScreen: CityScreen): Table() {
|
|||||||
} else {
|
} else {
|
||||||
"Stopped expansion".tr()
|
"Stopped expansion".tr()
|
||||||
}
|
}
|
||||||
if (!cityInfo.expansion.isAreaMaxed())
|
if (cityInfo.expansion.chooseNewTileToOwn()!=null)
|
||||||
turnsToExpansionString += " (" + cityInfo.expansion.cultureStored + "/" +
|
turnsToExpansionString += " (" + cityInfo.expansion.cultureStored + "/" +
|
||||||
cityInfo.expansion.getCultureToNextTile() + ")"
|
cityInfo.expansion.getCultureToNextTile() + ")"
|
||||||
|
|
||||||
|
@ -116,7 +116,7 @@ class TileEditorOptionsTable(val mapEditorScreen: MapEditorScreen): Table(Camera
|
|||||||
val tile = tileGroup.tileInfo
|
val tile = tileGroup.tileInfo
|
||||||
if (tile.improvement == improvementName && tile != it)
|
if (tile.improvement == improvementName && tile != it)
|
||||||
tile.improvement = null
|
tile.improvement = null
|
||||||
tile.setTransients()
|
tile.setTerrainTransients()
|
||||||
tileGroup.update()
|
tileGroup.update()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -249,7 +249,7 @@ class TileEditorOptionsTable(val mapEditorScreen: MapEditorScreen): Table(Camera
|
|||||||
} else tileInfo.baseTerrain = terrain
|
} else tileInfo.baseTerrain = terrain
|
||||||
|
|
||||||
tileInfo.resource = resource.name
|
tileInfo.resource = resource.name
|
||||||
tileInfo.setTransients()
|
tileInfo.setTerrainTransients()
|
||||||
|
|
||||||
setCurrentHex(tileInfo, resource.name.tr() + "\n" + resource.clone().toString())
|
setCurrentHex(tileInfo, resource.name.tr() + "\n" + resource.clone().toString())
|
||||||
}
|
}
|
||||||
@ -332,7 +332,7 @@ class TileEditorOptionsTable(val mapEditorScreen: MapEditorScreen): Table(Camera
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun makeTileGroup(tileInfo: TileInfo): TileGroup {
|
private fun makeTileGroup(tileInfo: TileInfo): TileGroup {
|
||||||
tileInfo.setTransients()
|
tileInfo.setTerrainTransients()
|
||||||
val group = TileGroup(tileInfo, TileSetStrings())
|
val group = TileGroup(tileInfo, TileSetStrings())
|
||||||
group.showEntireMap = true
|
group.showEntireMap = true
|
||||||
group.forMapEditorIcon = true
|
group.forMapEditorIcon = true
|
||||||
|
Reference in New Issue
Block a user