summaryrefslogtreecommitdiffstats
path: root/src/model
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2017-09-12 09:20:19 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2017-09-12 09:20:19 +0200
commit02758a69ac49cc437ed27628b64e08fd443758b8 (patch)
tree470d9980b9c2ec710f85a7c5b872d4b529e36a9e /src/model
parenta5e69edc5a6f1a95618c04e214d39b397577d796 (diff)
downloadrpgedit-02758a69ac49cc437ed27628b64e08fd443758b8.tar
rpgedit-02758a69ac49cc437ed27628b64e08fd443758b8.zip
Implement simple map renderer
Diffstat (limited to 'src/model')
-rw-r--r--src/model/MapData.ts26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/model/MapData.ts b/src/model/MapData.ts
new file mode 100644
index 0000000..b83e146
--- /dev/null
+++ b/src/model/MapData.ts
@@ -0,0 +1,26 @@
+import {mapFromObject} from '../util';
+
+
+interface Input {
+ tiles: {[key: string]: string};
+ collision: string[];
+ layers: string[][][];
+}
+
+export default class MapData {
+ tiles: Map<string, string>;
+ collision: string[];
+ layers: string[][][];
+
+ width: number;
+ height: number;
+
+ constructor(data: Input) {
+ this.tiles = mapFromObject(data.tiles);
+ this.collision = data.collision;
+ this.layers = data.layers;
+
+ this.height = this.collision.length;
+ this.width = this.collision[0].length;
+ }
+}