From ec0e51231f95b4d847e4e94eb7146d3a0c159512 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 11 Nov 2018 20:31:22 +0100 Subject: Prepare support for adding extra elements to map layers --- src/model/data/map.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/model') 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; } } -- cgit v1.2.3