slight optimizations
This commit is contained in:
parent
0fb19d45ad
commit
66d0642006
5 changed files with 77 additions and 71 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue