mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-27 13:55:54 -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() }
|
||||
}
|
||||
|
||||
/** DOES NOT hold untyped uniques! */
|
||||
class UniqueMapTyped: EnumMap<UniqueType, ArrayList<Unique>>(UniqueType::class.java) {
|
||||
fun addUnique(unique: Unique) {
|
||||
if(unique.type==null) return
|
||||
if (!containsKey(unique.type)) this[unique.type] = ArrayList()
|
||||
this[unique.type]!!.add(unique)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user