diff --git a/android/res/drawable-hdpi/uncivicon.png b/android/res/drawable-hdpi/uncivicon.png deleted file mode 100644 index 1acf874134..0000000000 Binary files a/android/res/drawable-hdpi/uncivicon.png and /dev/null differ diff --git a/android/res/drawable-mdpi/uncivicon.png b/android/res/drawable-mdpi/uncivicon.png deleted file mode 100644 index 84ae0df2f0..0000000000 Binary files a/android/res/drawable-mdpi/uncivicon.png and /dev/null differ diff --git a/android/res/drawable-xhdpi/uncivicon.png b/android/res/drawable-xhdpi/uncivicon.png deleted file mode 100644 index a2542f328b..0000000000 Binary files a/android/res/drawable-xhdpi/uncivicon.png and /dev/null differ diff --git a/android/res/drawable-xxhdpi/uncivicon.png b/android/res/drawable-xxhdpi/uncivicon.png deleted file mode 100644 index 15b063adbd..0000000000 Binary files a/android/res/drawable-xxhdpi/uncivicon.png and /dev/null differ diff --git a/android/res/drawable-xxxhdpi/uncivicon.png b/android/res/drawable-xxxhdpi/uncivicon.png deleted file mode 100644 index e30ce94ef1..0000000000 Binary files a/android/res/drawable-xxxhdpi/uncivicon.png and /dev/null differ diff --git a/core/src/com/unciv/logic/automation/NextTurnAutomation.kt b/core/src/com/unciv/logic/automation/NextTurnAutomation.kt index 61a006b531..7ff75e706c 100644 --- a/core/src/com/unciv/logic/automation/NextTurnAutomation.kt +++ b/core/src/com/unciv/logic/automation/NextTurnAutomation.kt @@ -32,7 +32,7 @@ class NextTurnAutomation{ } private fun buyBuildingOrUnit(civInfo: CivilizationInfo) { - //allow AI spending money to purchase building & unit. Buying staff has slightly lower priority than buying tech. + //allow AI spending money to purchase building & unit for (city in civInfo.cities.sortedByDescending{ it.population.population }) { val construction = city.cityConstructions.getCurrentConstruction() if (construction.canBePurchased() diff --git a/core/src/com/unciv/logic/city/CityInfo.kt b/core/src/com/unciv/logic/city/CityInfo.kt index 9c6a3a578f..01de2b688a 100644 --- a/core/src/com/unciv/logic/city/CityInfo.kt +++ b/core/src/com/unciv/logic/city/CityInfo.kt @@ -128,7 +128,7 @@ class CityInfo { } for (building in cityConstructions.getBuiltBuildings().filter { it.requiredResource != null }) { - val resource = GameBasics.TileResources[building.requiredResource] + val resource = GameBasics.TileResources[building.requiredResource]!! cityResources.add(resource, -1) } diff --git a/core/src/com/unciv/logic/civilization/CivilizationInfo.kt b/core/src/com/unciv/logic/civilization/CivilizationInfo.kt index c265470012..ce50a0ecce 100644 --- a/core/src/com/unciv/logic/civilization/CivilizationInfo.kt +++ b/core/src/com/unciv/logic/civilization/CivilizationInfo.kt @@ -230,7 +230,7 @@ class CivilizationInfo { val civResources = Counter() for (city in cities) civResources.add(city.getCityResources()) for (dip in diplomacy.values) civResources.add(dip.resourcesFromTrade()) - for(resource in getCivUnits().mapNotNull { it.baseUnit.requiredResource }.map { GameBasics.TileResources[it] }) + for(resource in getCivUnits().mapNotNull { it.baseUnit.requiredResource }.map { GameBasics.TileResources[it]!! }) civResources.add(resource,-1) return civResources } diff --git a/core/src/com/unciv/models/Counter.java b/core/src/com/unciv/models/Counter.java deleted file mode 100644 index 3e23b005fa..0000000000 --- a/core/src/com/unciv/models/Counter.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.unciv.models; - -import java.util.LinkedHashMap; - -public class Counter extends LinkedHashMap { - - public Integer get(Object key){ // don't return null if empty - if(containsKey(key)) return super.get(key); - else return 0; - } - - public void add(K key, int value){ - if(!containsKey(key)) put(key,value); - else put(key,get(key)+value); - if(get(key)==0) remove(key); // No objects of this sort left, no need to count - } - - public void add(Counter other){ - for (K key : other.keySet()) { - add(key,other.get(key)); - } - } - - public void remove(Counter other){ - for (K key : other.keySet()) { - add(key,-other.get(key)); - } - } - - @Override - public Counter clone() { - Counter newCounter = new Counter(); - newCounter.add(this); - return newCounter; - } -} diff --git a/core/src/com/unciv/models/Counter.kt b/core/src/com/unciv/models/Counter.kt new file mode 100644 index 0000000000..c4c6b20e80 --- /dev/null +++ b/core/src/com/unciv/models/Counter.kt @@ -0,0 +1,38 @@ +package com.unciv.models + +import java.util.* + +class Counter : LinkedHashMap() { + + override operator fun get(key: K): Int? { // don't return null if empty + if (containsKey(key)) + return super.get(key) + else return 0 + } + + fun add(key: K, value: Int) { + if (!containsKey(key)) + put(key, value) + else + put(key, get(key)!! + value) + if (get(key) == 0) remove(key) // No objects of this sort left, no need to count + } + + fun add(other: Counter) { + for (key in other.keys) { + add(key, other[key]!!) + } + } + + fun remove(other: Counter) { + for (key in other.keys) { + add(key, -other[key]!!) + } + } + + override fun clone(): Counter { + val newCounter = Counter() + newCounter.add(this) + return newCounter + } +}