summaryrefslogtreecommitdiffstats
path: root/src/renderer/runtime/model/data/map.ts
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2019-12-24 13:53:16 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2019-12-24 13:53:16 +0100
commit3c51a1994f41b625823c4f15e92396b5498ce23c (patch)
tree7a96310ec32df82ac87039ea555300bcab510a5e /src/renderer/runtime/model/data/map.ts
parent33926af829848050c54c698ed22da9fe2b912aea (diff)
downloadrpgedit-3c51a1994f41b625823c4f15e92396b5498ce23c.tar
rpgedit-3c51a1994f41b625823c4f15e92396b5498ce23c.zip
Move renderer into "runtime" subdirectory
Diffstat (limited to 'src/renderer/runtime/model/data/map.ts')
-rw-r--r--src/renderer/runtime/model/data/map.ts29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/renderer/runtime/model/data/map.ts b/src/renderer/runtime/model/data/map.ts
new file mode 100644
index 0000000..81ce051
--- /dev/null
+++ b/src/renderer/runtime/model/data/map.ts
@@ -0,0 +1,29 @@
+import { Collision } from './collision';
+
+export interface MapLayer {
+ readonly tiles: number[][];
+}
+
+export interface MapDataInput {
+ readonly tiles: string[];
+ readonly layers: MapLayer[];
+ readonly collision: Collision[];
+}
+
+export class MapData {
+ public readonly tiles: string[];
+ public readonly layers: MapLayer[];
+ public readonly collision: Collision[];
+
+ public readonly width: number;
+ public readonly height: number;
+
+ constructor(data: MapDataInput) {
+ this.tiles = data.tiles;
+ this.layers = data.layers;
+ this.collision = data.collision;
+
+ this.height = this.layers[0].tiles.length;
+ this.width = this.layers[0].tiles[0].length;
+ }
+}