mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-20 09:17:47 +07:00
Resolved #694, and another crashing bug
This commit is contained in:
parent
628463cc54
commit
827d24c778
@ -21,7 +21,7 @@ android {
|
|||||||
applicationId "com.unciv.app"
|
applicationId "com.unciv.app"
|
||||||
minSdkVersion 14
|
minSdkVersion 14
|
||||||
targetSdkVersion 28
|
targetSdkVersion 28
|
||||||
versionCode 234
|
versionCode 236
|
||||||
versionName "2.16.0"
|
versionName "2.16.0"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ class NextTurnAutomation{
|
|||||||
}
|
}
|
||||||
|
|
||||||
val otherCivList = civInfo.getKnownCivs()
|
val otherCivList = civInfo.getKnownCivs()
|
||||||
.filter { it.playerType == PlayerType.AI && !it.isBarbarianCivilization() }
|
.filter { it.playerType == PlayerType.AI && it.isMajorCiv() }
|
||||||
.sortedBy { it.tech.techsResearched.size }
|
.sortedBy { it.tech.techsResearched.size }
|
||||||
|
|
||||||
for (otherCiv in otherCivList) {
|
for (otherCiv in otherCivList) {
|
||||||
|
@ -19,6 +19,7 @@ class CityInfo {
|
|||||||
@Transient var isConnectedToCapital = false
|
@Transient var isConnectedToCapital = false
|
||||||
@Transient lateinit var ccenterTile:TileInfo // cached for better performance
|
@Transient lateinit var ccenterTile:TileInfo // cached for better performance
|
||||||
@Transient val range = 2
|
@Transient val range = 2
|
||||||
|
@Transient lateinit var tileMap: TileMap
|
||||||
|
|
||||||
var location: Vector2 = Vector2.Zero
|
var location: Vector2 = Vector2.Zero
|
||||||
var name: String = ""
|
var name: String = ""
|
||||||
@ -96,8 +97,7 @@ class CityInfo {
|
|||||||
return toReturn
|
return toReturn
|
||||||
}
|
}
|
||||||
|
|
||||||
internal val tileMap: TileMap
|
|
||||||
get() = civInfo.gameInfo.tileMap
|
|
||||||
|
|
||||||
fun getCenterTile(): TileInfo = ccenterTile
|
fun getCenterTile(): TileInfo = ccenterTile
|
||||||
fun getTiles(): List<TileInfo> = tiles.map { tileMap[it] }
|
fun getTiles(): List<TileInfo> = tiles.map { tileMap[it] }
|
||||||
@ -183,6 +183,7 @@ class CityInfo {
|
|||||||
|
|
||||||
//region state-changing functions
|
//region state-changing functions
|
||||||
fun setTransients() {
|
fun setTransients() {
|
||||||
|
tileMap = civInfo.gameInfo.tileMap
|
||||||
ccenterTile = tileMap[location]
|
ccenterTile = tileMap[location]
|
||||||
population.cityInfo = this
|
population.cityInfo = this
|
||||||
expansion.cityInfo = this
|
expansion.cityInfo = this
|
||||||
|
@ -98,7 +98,8 @@ class CivilizationInfo {
|
|||||||
toReturn.goldenAges = goldenAges.clone()
|
toReturn.goldenAges = goldenAges.clone()
|
||||||
toReturn.greatPeople = greatPeople.clone()
|
toReturn.greatPeople = greatPeople.clone()
|
||||||
toReturn.victoryManager = victoryManager.clone()
|
toReturn.victoryManager = victoryManager.clone()
|
||||||
toReturn.diplomacy.putAll(diplomacy)
|
for(diplomacyManager in diplomacy.values.map { it.clone() })
|
||||||
|
toReturn.diplomacy.put(diplomacyManager.otherCivName, diplomacyManager)
|
||||||
toReturn.cities = cities.map { it.clone() }
|
toReturn.cities = cities.map { it.clone() }
|
||||||
toReturn.exploredTiles.addAll(exploredTiles)
|
toReturn.exploredTiles.addAll(exploredTiles)
|
||||||
toReturn.notifications.addAll(notifications)
|
toReturn.notifications.addAll(notifications)
|
||||||
|
@ -7,4 +7,14 @@ enum class AlertType{
|
|||||||
CityConquered
|
CityConquered
|
||||||
}
|
}
|
||||||
|
|
||||||
class PopupAlert (val type:AlertType, val value:String)
|
class PopupAlert {
|
||||||
|
lateinit var type: AlertType
|
||||||
|
lateinit var value: String
|
||||||
|
|
||||||
|
constructor(type: AlertType, value: String) {
|
||||||
|
this.type = type
|
||||||
|
this.value = value
|
||||||
|
}
|
||||||
|
|
||||||
|
constructor() // for json serialization
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user