slight optimizations

This commit is contained in:
biglyderv 2025-05-16 21:44:56 -04:00
parent 0fb19d45ad
commit 66d0642006
Signed by: biglyderv
GPG key ID: 0E2EB0B4CD7397B5
5 changed files with 77 additions and 71 deletions

View file

@ -20,14 +20,15 @@ function getContrast(r, g, b) {
}
function Tile(color, id, isAbstract = false, copyFrom = false, copyFromName = false) {
this.hook = this.hook || [];
if (copyFrom) {
let that = this;
this.hook = function () {
this.hook.push(function () {
let oldie = mainTiles.resolve(copyFrom, copyFromName);
Object.assign(that, Object.assign({}, oldie, that));
that.attributes = Object.assign({}, that.attributes);
that.interactions = that.interactions.concat(oldie.interactions)
}
})
}
this.color = color;