diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2017-09-12 09:20:19 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2017-09-12 09:20:19 +0200 |
commit | 02758a69ac49cc437ed27628b64e08fd443758b8 (patch) | |
tree | 470d9980b9c2ec710f85a7c5b872d4b529e36a9e /src/model | |
parent | a5e69edc5a6f1a95618c04e214d39b397577d796 (diff) | |
download | rpgedit-02758a69ac49cc437ed27628b64e08fd443758b8.tar rpgedit-02758a69ac49cc437ed27628b64e08fd443758b8.zip |
Implement simple map renderer
Diffstat (limited to 'src/model')
-rw-r--r-- | src/model/MapData.ts | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/model/MapData.ts b/src/model/MapData.ts new file mode 100644 index 0000000..b83e146 --- /dev/null +++ b/src/model/MapData.ts @@ -0,0 +1,26 @@ +import {mapFromObject} from '../util'; + + +interface Input { + tiles: {[key: string]: string}; + collision: string[]; + layers: string[][][]; +} + +export default class MapData { + tiles: Map<string, string>; + collision: string[]; + layers: string[][][]; + + width: number; + height: number; + + 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; + } +} |