summaryrefslogtreecommitdiffstats
path: root/src/model
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2018-11-11 20:31:22 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2018-11-11 20:31:22 +0100
commitec0e51231f95b4d847e4e94eb7146d3a0c159512 (patch)
tree8f14cdd4790b4fefe78d1f1db41cc7d9bb263520 /src/model
parente77b54f01b86f095363ee5217f7179a38b324c63 (diff)
downloadrpgedit-ec0e51231f95b4d847e4e94eb7146d3a0c159512.tar
rpgedit-ec0e51231f95b4d847e4e94eb7146d3a0c159512.zip
Prepare support for adding extra elements to map layers
Diffstat (limited to 'src/model')
-rw-r--r--src/model/data/map.ts12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/model/data/map.ts b/src/model/data/map.ts
index b36f6b5..81ce051 100644
--- a/src/model/data/map.ts
+++ b/src/model/data/map.ts
@@ -1,14 +1,18 @@
import { Collision } from './collision';
+export interface MapLayer {
+ readonly tiles: number[][];
+}
+
export interface MapDataInput {
readonly tiles: string[];
- readonly layers: number[][][];
+ readonly layers: MapLayer[];
readonly collision: Collision[];
}
export class MapData {
public readonly tiles: string[];
- public readonly layers: number[][][];
+ public readonly layers: MapLayer[];
public readonly collision: Collision[];
public readonly width: number;
@@ -19,7 +23,7 @@ export class MapData {
this.layers = data.layers;
this.collision = data.collision;
- this.height = this.layers[0].length;
- this.width = this.layers[0][0].length;
+ this.height = this.layers[0].tiles.length;
+ this.width = this.layers[0].tiles[0].length;
}
}