Add change function
This commit is contained in:
@@ -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 = [];
|
||||
|
Reference in New Issue
Block a user