summaryrefslogtreecommitdiffstats
path: root/src/model
diff options
context:
space:
mode:
Diffstat (limited to 'src/model')
-rw-r--r--src/model/MapData.ts31
1 files changed, 15 insertions, 16 deletions
diff --git a/src/model/MapData.ts b/src/model/MapData.ts
index b83e146..dcb98b8 100644
--- a/src/model/MapData.ts
+++ b/src/model/MapData.ts
@@ -1,26 +1,25 @@
import {mapFromObject} from '../util';
-
interface Input {
- tiles: {[key: string]: string};
- collision: string[];
- layers: string[][][];
+ tiles: {[key: string]: string};
+ collision: string[];
+ layers: string[][][];
}
export default class MapData {
- tiles: Map<string, string>;
- collision: string[];
- layers: string[][][];
+ public tiles: Map<string, string>;
+ public collision: string[];
+ public layers: string[][][];
- width: number;
- height: number;
+ public width: number;
+ public height: number;
- constructor(data: Input) {
- this.tiles = mapFromObject(data.tiles);
- this.collision = data.collision;
- this.layers = data.layers;
+ 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;
- }
+ this.height = this.collision.length;
+ this.width = this.collision[0].length;
+ }
}