Ongoing cleanup and refactoring of maps.
This commit is contained in:
@@ -52,6 +52,7 @@ export class MapList {
|
||||
|
||||
add(key, map) {
|
||||
if (this.maps[key] != null) consol.warn('Key already in mapList. The existing key was overwritten.')
|
||||
if (this.active == null) this.active = key
|
||||
map.name = key
|
||||
this.maps[key] = map
|
||||
}
|
||||
@@ -65,7 +66,13 @@ export class MapList {
|
||||
let idx = keys.indexOf(this.active)
|
||||
|
||||
let next = idx + 1 < keys.length ? keys[idx + 1] : keys[0]
|
||||
console.log(keys, idx, next)
|
||||
return next
|
||||
}
|
||||
|
||||
cleanup() {
|
||||
for (let key in this.maps) {
|
||||
let map = this.maps[key]
|
||||
map.remove()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user