2021-05-13 04:09:46 +00:00
|
|
|
import { AnimatableTileFactory } from './animatable_tile_factory.js';
|
2021-05-12 04:48:16 +00:00
|
|
|
import { SequenceTile } from './sequence_tile.js';
|
2021-05-13 04:09:46 +00:00
|
|
|
export class SequenceTileFactory extends AnimatableTileFactory {
|
2021-05-12 04:48:16 +00:00
|
|
|
constructor(tile_factories, delay, repeat) {
|
|
|
|
|
super(tile_factories[0].layer_name, tile_factories[0].width, tile_factories[0].height);
|
|
|
|
|
this.tile_factories = tile_factories;
|
|
|
|
|
this.delay = delay;
|
|
|
|
|
this.repeat = repeat;
|
|
|
|
|
}
|
|
|
|
|
build(tileset) {
|
|
|
|
|
const tiles = [];
|
|
|
|
|
for (const tile_factory of this.tile_factories) {
|
|
|
|
|
tiles.push(tile_factory.build(tileset));
|
|
|
|
|
}
|
2021-05-17 04:26:18 +00:00
|
|
|
return new SequenceTile(...this.animatable_tile_args(), tiles, this.delay, this.repeat);
|
2021-05-12 04:48:16 +00:00
|
|
|
}
|
|
|
|
|
copy() {
|
|
|
|
|
return new SequenceTileFactory(this.tile_factories, this.delay, this.repeat);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//# sourceMappingURL=sequence_tile_factory.js.map
|