summaryrefslogtreecommitdiffstats
path: root/src/model/data
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2018-11-05 01:28:35 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2018-11-05 01:28:35 +0100
commit9be9f8e73940f1a38410575557fcd57cc620a8f4 (patch)
tree40e42751c97d7e213aefa719feac9d5509810376 /src/model/data
parent5593bf2d364667d8402daa8fde8f43647f7360a6 (diff)
downloadrpgedit-9be9f8e73940f1a38410575557fcd57cc620a8f4.tar
rpgedit-9be9f8e73940f1a38410575557fcd57cc620a8f4.zip
Read collision barriers from map file
Diffstat (limited to 'src/model/data')
-rw-r--r--src/model/data/map.ts10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/model/data/map.ts b/src/model/data/map.ts
index d6fd835..4d9ecda 100644
--- a/src/model/data/map.ts
+++ b/src/model/data/map.ts
@@ -1,11 +1,20 @@
+export interface CollisionPolygon {
+ readonly type: 'polygon';
+ readonly vertices: Array<[number, number]>;
+}
+
+export type Collision = CollisionPolygon;
+
export interface Input {
readonly tiles: string[];
readonly layers: number[][][];
+ readonly collision: Collision[];
}
export class MapData {
public readonly tiles: string[];
public readonly layers: number[][][];
+ public readonly collision: Collision[];
public readonly width: number;
public readonly height: number;
@@ -13,6 +22,7 @@ export class MapData {
constructor(data: Input) {
this.tiles = data.tiles;
this.layers = data.layers;
+ this.collision = data.collision;
this.height = this.layers[0].length;
this.width = this.layers[0][0].length;