mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-28 14:24:43 -04:00
Fixed error where typed unique map would try and register untyped uniques
This commit is contained in:
parent
ff389e0238
commit
198958772c
@ -131,8 +131,10 @@ class UniqueMap: HashMap<String, ArrayList<Unique>>() {
|
|||||||
fun getAllUniques() = this.asSequence().flatMap { it.value.asSequence() }
|
fun getAllUniques() = this.asSequence().flatMap { it.value.asSequence() }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** DOES NOT hold untyped uniques! */
|
||||||
class UniqueMapTyped: EnumMap<UniqueType, ArrayList<Unique>>(UniqueType::class.java) {
|
class UniqueMapTyped: EnumMap<UniqueType, ArrayList<Unique>>(UniqueType::class.java) {
|
||||||
fun addUnique(unique: Unique) {
|
fun addUnique(unique: Unique) {
|
||||||
|
if(unique.type==null) return
|
||||||
if (!containsKey(unique.type)) this[unique.type] = ArrayList()
|
if (!containsKey(unique.type)) this[unique.type] = ArrayList()
|
||||||
this[unique.type]!!.add(unique)
|
this[unique.type]!!.add(unique)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user