Add change function

This commit is contained in:
2022-02-09 14:38:34 +01:00
parent 24e5650f09
commit f8f4c555b8

View File

@@ -15,6 +15,12 @@ class State {
return this.states.set(key, value);
}
change(key, amount = 1) {
let val = this.get(key, 0);
val += amount;
this.set(key, val);
}
serialize() {
const entries = this.states.entries();
const entrymap = [];