Factor out AnimatableTile{Factory}
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user