feat: LayerProxy::tile

This commit is contained in:
cha0s 2024-06-25 07:08:50 -05:00
parent ae9370c6d7
commit fbbd74f778

View File

@ -66,6 +66,12 @@ export default function(Component) {
}
Component.markChange(instance.entity, 'layerChange', {[index]: changes});
}
tile({x, y}) {
if (x < 0 || y < 0 || x >= this.layer.area.x || y >= this.layer.area.y) {
return undefined;
}
return this.layer.data[y * this.layer.area.x + x];
}
}
return new LayerProxy(layers[index]);
};