Walkable mask painting

This commit is contained in:
Ian Gulliver
2021-05-17 04:26:18 +00:00
parent 0030b63e3a
commit 9d681291cc
43 changed files with 577 additions and 362 deletions

View File

@@ -1,9 +1,11 @@
import { Mask } from './mask.js';
import { Tile } from './tile.js';
export abstract class TileFactory {
layer_name: string;
width: number;
height: number;
masks: Map<string, Mask> = new Map<string, Mask>();
constructor(layer_name: string, width: number, height: number) {
this.layer_name = layer_name;
@@ -11,6 +13,18 @@ export abstract class TileFactory {
this.height = height;
}
add_mask(name: string, mask: Mask) {
this.masks.set(name, mask);
}
tile_args(): [number, number, Map<string, Mask>] {
return [
this.width,
this.height,
this.masks,
];
}
abstract build(tileset: string): Tile;
abstract copy(): TileFactory;