chore: LayerProxy API
This commit is contained in:
parent
ac12fafa16
commit
309c94bbfc
|
@ -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]);
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue
Block a user