added saving/loading sim controls

This commit is contained in:
MaxRobinsonTheGreat
2021-12-18 15:05:35 -06:00
parent 9691583f73
commit 302eeae2fb
4 changed files with 38 additions and 5 deletions

View File

@@ -2,8 +2,6 @@ const Neighbors = require("./Grid/Neighbors");
const Hyperparams = {
setDefaults: function() {
this.headless = false;
this.lifespanMultiplier = 100;
this.foodProdProb = 5;
this.killableNeighbors = Neighbors.adjacent;
@@ -27,6 +25,12 @@ const Hyperparams = {
this.foodDropProb = 0;
},
loadJsonObj(obj) {
for (let key in obj) {
this[key] = obj[key];
}
}
}
Hyperparams.setDefaults();