chore: LayerProxy API

This commit is contained in:
cha0s 2024-06-26 04:16:14 -05:00
parent ac12fafa16
commit 309c94bbfc

View File

@ -48,6 +48,12 @@ export default function(Component) {
constructor(layer) {
this.layer = layer;
}
get area() {
return this.layer.area;
}
get source() {
return this.layer.source;
}
stamp(at, data) {
const changes = {};
for (const row in data) {
@ -72,6 +78,9 @@ export default function(Component) {
}
return this.layer.data[y * this.layer.area.x + x];
}
get tileSize() {
return this.layer.tileSize;
}
}
return new LayerProxy(layers[index]);
};