added world saving/loading

This commit is contained in:
MaxRobinsonTheGreat
2022-04-15 13:13:19 -05:00
parent dabeb4463d
commit 8df3accff7
9 changed files with 184 additions and 25 deletions

View File

@@ -6,6 +6,14 @@ const SerializeHelper = {
newobj[key] = obj[key];
}
return newobj;
},
overwriteNonObjects(copyFrom, copyTo) {
for (let key in copyFrom) {
if (typeof copyFrom[key] !== 'object' && typeof copyTo[key] !== 'object') {
// only overwrite if neither are objects
copyTo[key] = copyFrom[key];
}
}
}
}