Ongoing cleanup and refactoring of maps.

This commit is contained in:
2019-11-25 18:04:11 +01:00
parent 88048f14ec
commit 5305561619
16 changed files with 462 additions and 158 deletions
+8 -1
View File
@@ -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()
}
}
}