mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-23 14:19:15 +07:00
Allow ai city to re-assign specialists.
This commit is contained in:
@ -117,6 +117,7 @@ class NextTurnAutomation{
|
|||||||
private fun reassignWorkedTiles(civInfo: CivilizationInfo) {
|
private fun reassignWorkedTiles(civInfo: CivilizationInfo) {
|
||||||
for (city in civInfo.cities) {
|
for (city in civInfo.cities) {
|
||||||
city.workedTiles.clear()
|
city.workedTiles.clear()
|
||||||
|
city.population.specialists.clear()
|
||||||
(0..city.population.population).forEach { city.population.autoAssignPopulation() }
|
(0..city.population.population).forEach { city.population.autoAssignPopulation() }
|
||||||
Automation().chooseNextConstruction(city.cityConstructions)
|
Automation().chooseNextConstruction(city.cityConstructions)
|
||||||
if (city.health < city.getMaxHealth())
|
if (city.health < city.getMaxHealth())
|
||||||
|
@ -15,6 +15,15 @@ open class Stats() {
|
|||||||
setStats(hashMap)
|
setStats(hashMap)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun clear() {
|
||||||
|
production = 0f
|
||||||
|
food = 0f
|
||||||
|
gold = 0f
|
||||||
|
science = 0f
|
||||||
|
culture = 0f
|
||||||
|
happiness = 0f
|
||||||
|
}
|
||||||
|
|
||||||
fun add(other: Stats) {
|
fun add(other: Stats) {
|
||||||
// Doing this through the hashmap is nicer code but is SUPER INEFFICIENT!
|
// Doing this through the hashmap is nicer code but is SUPER INEFFICIENT!
|
||||||
production += other.production
|
production += other.production
|
||||||
|
Reference in New Issue
Block a user