2021-05-17 04:26:18 +00:00
|
|
|
import { Mask } from './mask.js';
|
2021-05-11 05:28:20 +00:00
|
|
|
import { TileFactory } from './tile_factory.js';
|
|
|
|
|
|
|
|
|
|
export abstract class AnimatableTileFactory extends TileFactory {
|
|
|
|
|
animations: Map<string, [Keyframe[], object]> = new Map();
|
|
|
|
|
|
|
|
|
|
add_animation(name: string, keyframes: Keyframe[], options: object) {
|
|
|
|
|
this.animations.set(name, [keyframes, options]);
|
|
|
|
|
}
|
|
|
|
|
|
2021-05-17 04:26:18 +00:00
|
|
|
animatable_tile_args(): [number, number, Map<string, Mask>, Map<string, [Keyframe[], object]>] {
|
|
|
|
|
return [
|
|
|
|
|
...super.tile_args(),
|
|
|
|
|
this.animations,
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
|
2021-05-11 05:28:20 +00:00
|
|
|
abstract copy(): AnimatableTileFactory;
|
|
|
|
|
}
|