summaryrefslogtreecommitdiffstats
path: root/src/model/data/map.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/model/data/map.ts')
-rw-r--r--src/model/data/map.ts23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/model/data/map.ts b/src/model/data/map.ts
new file mode 100644
index 0000000..50b9175
--- /dev/null
+++ b/src/model/data/map.ts
@@ -0,0 +1,23 @@
+export interface Input {
+ readonly tiles: string[];
+ readonly collision: boolean[][];
+ readonly layers: number[][][];
+}
+
+export class MapData {
+ public readonly tiles: string[];
+ public readonly collision: boolean[][];
+ public readonly layers: number[][][];
+
+ public readonly width: number;
+ public readonly 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;
+ }
+}