refactor: unify
This commit is contained in:
parent
7534cfa65d
commit
60d490b590
|
@ -196,16 +196,7 @@ export default (flecks) => {
|
|||
}
|
||||
|
||||
setTileAt([x, y], tile) {
|
||||
const [w, h] = this.area;
|
||||
const index = y * w + x;
|
||||
if (x < 0 || x >= w || y < 0 || y >= h || this.$$data[index] === tile) {
|
||||
return;
|
||||
}
|
||||
this.$$data[index] = tile;
|
||||
if ('web' !== process.env.FLECKS_CORE_BUILD_TARGET) {
|
||||
this.$$updates.push([[x, y], [1, 1], [tile]]);
|
||||
this.$$hasUpdates = true;
|
||||
}
|
||||
return this.stampAt([x, y, 1, 1], [tile]);
|
||||
}
|
||||
|
||||
/* eslint-disable no-param-reassign */
|
||||
|
|
Loading…
Reference in New Issue
Block a user