mirror of
https://github.com/kolbytn/mindcraft.git
synced 2025-04-29 19:44:53 +02:00
25 lines
No EOL
333 B
JavaScript
25 lines
No EOL
333 B
JavaScript
export class MemoryBank {
|
|
constructor() {
|
|
this.memory = {};
|
|
}
|
|
|
|
rememberPlace(name, x, y, z) {
|
|
this.memory[name] = [x, y, z];
|
|
}
|
|
|
|
recallPlace(name) {
|
|
return this.memory[name];
|
|
}
|
|
|
|
getJson() {
|
|
return this.memory
|
|
}
|
|
|
|
loadJson(json) {
|
|
this.memory = json;
|
|
}
|
|
|
|
getKeys() {
|
|
return Object.keys(this.memory).join(', ')
|
|
}
|
|
} |