summaryrefslogtreecommitdiffstats
path: root/src/model/data/map.ts
blob: 50b91758f2c4f239c36946920fdce0763e9b9256 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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;
	}
}