Factor out AnimatableTile{Factory}

This commit is contained in:
Ian Gulliver
2021-05-11 05:28:20 +00:00
parent 4e65819183
commit 8f76317ccc
16 changed files with 80 additions and 51 deletions

View File

@@ -1,18 +1,12 @@
import { SimpleTile } from './simple_tile.js';
import { TileFactory } from './tile_factory.js';
import { AnimatableTileFactory } from './animatable_tile_factory.js';
export class SimpleTileFactory extends TileFactory {
export class SimpleTileFactory extends AnimatableTileFactory {
name: string;
animations: Map<string, [Keyframe[], object]>;
constructor(layer_name: string, width: number, height: number, name: string) {
super(layer_name, width, height);
this.name = name;
this.animations = new Map();
}
add_animation(name: string, keyframes: Keyframe[], options: object) {
this.animations.set(name, [keyframes, options]);
}
build(tileset: string): SimpleTile {