diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2018-12-08 12:39:18 +0100 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2018-12-08 12:39:18 +0100 |
commit | b3950330e3351437f153c6c1debb3821d6e28864 (patch) | |
tree | 0b381b523045bd59cd679825a11976a45813fc24 /src/model/data | |
parent | 439dcf391784ea3abb61473c74b9c27fcd9fdc2d (diff) | |
download | rpgedit-b3950330e3351437f153c6c1debb3821d6e28864.tar rpgedit-b3950330e3351437f153c6c1debb3821d6e28864.zip |
Create Electron app
Diffstat (limited to 'src/model/data')
-rw-r--r-- | src/model/data/collision.ts | 12 | ||||
-rw-r--r-- | src/model/data/entity.ts | 29 | ||||
-rw-r--r-- | src/model/data/map.ts | 29 |
3 files changed, 0 insertions, 70 deletions
diff --git a/src/model/data/collision.ts b/src/model/data/collision.ts deleted file mode 100644 index 29d0879..0000000 --- a/src/model/data/collision.ts +++ /dev/null @@ -1,12 +0,0 @@ -export interface PolygonCollision { - readonly type: 'polygon'; - readonly vertices: Array<[number, number]>; -} - -export interface CircleCollision { - readonly type: 'circle'; - readonly center: [number, number]; - readonly radius: number; -} - -export type Collision = PolygonCollision | CircleCollision; diff --git a/src/model/data/entity.ts b/src/model/data/entity.ts deleted file mode 100644 index f52c130..0000000 --- a/src/model/data/entity.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { Collision } from './collision'; - -export interface EntityAnimation { - readonly sequence: ReadonlyArray<[number, number]>; -} - -export interface EntityDataInput { - readonly sprite: string; - readonly anchor?: [number, number]; - readonly collision?: Collision[]; - readonly frames?: number; - readonly animation?: EntityAnimation; -} - -export class EntityData { - public readonly sprite: string; - public readonly anchor: [number, number]; - public readonly collision: Collision[]; - public readonly frames: number; - public readonly animation?: EntityAnimation; - - constructor(input: EntityDataInput) { - this.sprite = input.sprite; - this.anchor = input.anchor || [0.5, 0.5]; - this.collision = input.collision || []; - this.frames = input.frames || 1; - this.animation = input.animation; - } -} diff --git a/src/model/data/map.ts b/src/model/data/map.ts deleted file mode 100644 index 81ce051..0000000 --- a/src/model/data/map.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { Collision } from './collision'; - -export interface MapLayer { - readonly tiles: number[][]; -} - -export interface MapDataInput { - readonly tiles: string[]; - readonly layers: MapLayer[]; - readonly collision: Collision[]; -} - -export class MapData { - public readonly tiles: string[]; - public readonly layers: MapLayer[]; - public readonly collision: Collision[]; - - public readonly width: number; - public readonly height: number; - - constructor(data: MapDataInput) { - this.tiles = data.tiles; - this.layers = data.layers; - this.collision = data.collision; - - this.height = this.layers[0].tiles.length; - this.width = this.layers[0].tiles[0].length; - } -} |