From ebc56db63c054702ad910987aa666d7cfb52d5cc Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 24 Oct 2018 23:05:13 +0200 Subject: Move shader initialization out of renderer Avoid public fields and ! overrides, make almost all fields readonly. --- src/model/MapData.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/model') diff --git a/src/model/MapData.ts b/src/model/MapData.ts index dcb98b8..c8db35c 100644 --- a/src/model/MapData.ts +++ b/src/model/MapData.ts @@ -1,18 +1,18 @@ import {mapFromObject} from '../util'; interface Input { - tiles: {[key: string]: string}; - collision: string[]; - layers: string[][][]; + readonly tiles: {[key: string]: string}; + readonly collision: string[]; + readonly layers: string[][][]; } export default class MapData { - public tiles: Map; - public collision: string[]; - public layers: string[][][]; + public readonly tiles: Map; + public readonly collision: string[]; + public readonly layers: string[][][]; - public width: number; - public height: number; + public readonly width: number; + public readonly height: number; constructor(data: Input) { this.tiles = mapFromObject(data.tiles); -- cgit v1.2.3