summaryrefslogtreecommitdiffstats
path: root/src/model
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2016-01-07 21:01:02 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2016-01-07 21:01:02 +0100
commit6c896c3f23895582967aadb8d379d617d757f2fd (patch)
treee27c3ed856dff953960d94c10632846d5a501853 /src/model
parenta09b58b54c19673d3b699b069d0c7683053e27d3 (diff)
downloadrpgedit-6c896c3f23895582967aadb8d379d617d757f2fd.tar
rpgedit-6c896c3f23895582967aadb8d379d617d757f2fd.zip
Implement collision handling
Diffstat (limited to 'src/model')
-rw-r--r--src/model/MapData.ts10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/model/MapData.ts b/src/model/MapData.ts
index 54894c0..14f2586 100644
--- a/src/model/MapData.ts
+++ b/src/model/MapData.ts
@@ -9,12 +9,18 @@ interface Input {
export default class MapData {
tiles: {[key: string]: {file: string}};
- public collision: string[];
- public layers: string[][][];
+ collision: string[];
+ layers: string[][][];
+
+ width: number;
+ height: number;
constructor(data: Input) {
this.tiles = data.tiles;
this.collision = data.collision;
this.layers = data.layers;
+
+ this.height = this.collision.length;
+ this.width = this.collision[0].length;
}
}