Files
tower/js/layered_tile_factory.js

19 lines
701 B
JavaScript
Raw Normal View History

2021-05-11 02:57:17 +00:00
import { LayeredTile } from './layered_tile.js';
2021-05-11 02:21:23 +00:00
import { TileFactory } from './tile_factory.js';
export class LayeredTileFactory extends TileFactory {
2021-05-11 02:57:17 +00:00
constructor(tile_factories) {
super(tile_factories[0].layer_name, tile_factories[0].width, tile_factories[0].height);
2021-05-11 02:57:17 +00:00
this.tile_factories = tile_factories;
2021-05-10 05:20:29 +00:00
}
2021-05-11 02:57:17 +00:00
build(tileset) {
const tiles = [];
for (const tile_factory of this.tile_factories) {
tiles.push(tile_factory.build(tileset));
2021-05-10 05:20:29 +00:00
}
2021-05-11 02:57:17 +00:00
return new LayeredTile(this.width, this.height, tiles);
2021-05-10 05:20:29 +00:00
}
2021-05-11 05:17:16 +00:00
copy() {
return new LayeredTileFactory(this.tile_factories);
}
2021-05-10 05:20:29 +00:00
}
2021-05-11 02:21:23 +00:00
//# sourceMappingURL=layered_tile_factory.js.map