Added extra cities for civilizations (because I actually reached 10+ cities for an AI)
City naming is now dependant on the names of existing cities and not on the umber of cities the civ currently has
This commit is contained in:
parent
4cfbf18178
commit
d12b665e83
3 changed files with 12 additions and 7 deletions
|
@ -3,23 +3,25 @@
|
|||
name:"Babylon",
|
||||
RGB:[220,20,60],
|
||||
cities:["Babylon","Akkad","Dur-Kurigalzu","Nippur","Borsippa","Sippar","Opis","Mari","Shushan","Eshnunna",
|
||||
"Ellasar","Erech","Kutha","Sirpurla","Neribtum"]
|
||||
"Ellasar","Erech","Kutha","Sirpurla","Neribtum"]
|
||||
},
|
||||
{
|
||||
name:"Greece",
|
||||
RGB:[ 101, 153, 255],
|
||||
cities:["Athens","Sparta","Corinth","Argos","Knossos","Mycenae","Pharsalos","Ephesus","Halicarnassus","Rhodes",
|
||||
"Eretria","Pergamon","Miletos","Megara","Phocaea"]
|
||||
"Eretria","Pergamon","Miletos","Megara","Phocaea"]
|
||||
},
|
||||
{
|
||||
name:"China",
|
||||
RGB:[ 9, 112, 84],
|
||||
cities:["Beijing","Shanghai","Guangzhou","Nanjing","Xian","Chengdu","Hangzhou","Tianjin","Macau","Shandong"]
|
||||
cities:["Beijing","Shanghai","Guangzhou","Nanjing","Xian","Chengdu","Hangzhou","Tianjin","Macau","Shandong",
|
||||
"Kaifeng","Ningbo","Baoding","Yangzhou","Harbin"]
|
||||
},
|
||||
{
|
||||
name:"Egypt",
|
||||
RGB:[ 255, 153, 0],
|
||||
cities:["Thebes","Memphis","Heliopolis","Elephantine","Alexandria","Pi-Ramesses","Giza","Byblos","Akhetaten","Hieraconpolis"]
|
||||
cities:["Thebes","Memphis","Heliopolis","Elephantine","Alexandria","Pi-Ramesses","Giza","Byblos","Akhetaten","Hieraconpolis",
|
||||
"Abydos","Asyut","Avaris","Lisht","Buto"]
|
||||
},
|
||||
{
|
||||
name:"Barbarians",
|
||||
|
|
|
@ -84,7 +84,10 @@ class CityInfo {
|
|||
this.civInfo = civInfo
|
||||
setTransients()
|
||||
|
||||
name = civInfo.getCivilization().cities[civInfo.cities.size]
|
||||
// Since cities can be captures between civilizations,
|
||||
// we need to check which other cities exist globally and name accordingly
|
||||
val allExistingCityNames = civInfo.gameInfo.civilizations.flatMap { it.cities }.map { it.name }.toHashSet()
|
||||
name = civInfo.getCivilization().cities.first { !allExistingCityNames.contains(it) }
|
||||
this.location = cityLocation
|
||||
civInfo.cities.add(this)
|
||||
if(civInfo == civInfo.gameInfo.getPlayerCivilization())
|
||||
|
|
|
@ -66,10 +66,10 @@ class UnitTable(val worldScreen: WorldScreen) : Table(){
|
|||
if(currentlyExecutingAction=="moveTo"){
|
||||
|
||||
if(selectedUnit!!.movementAlgs()
|
||||
.getShortestPath(selectedUnit!!.getTile().position, selectedTile.position).isEmpty())
|
||||
.getShortestPath(selectedTile).isEmpty())
|
||||
return // can't reach there with the selected unit, watcha want me to do?
|
||||
|
||||
val reachedTile = selectedUnit!!.headTowards(selectedTile.position)
|
||||
val reachedTile = selectedUnit!!.movementAlgs().headTowards(selectedTile)
|
||||
|
||||
if(reachedTile!=selectedTile) // Didn't get all the way there
|
||||
selectedUnit!!.action = "moveTo " + selectedTile.position.x.toInt() + "," + selectedTile.position.y.toInt()
|
||||
|
|
Loading…
Reference in a new issue