Throw in tslint and fix style

This commit is contained in:
Matthias Schiffer 2018-10-24 01:26:15 +02:00
parent 06b2c5bec7
commit 9770eaf432
Signed by: neocturne
GPG key ID: 16EF3F64CB201D9C
9 changed files with 303 additions and 170 deletions

View file

@ -1,26 +1,25 @@
import {mapFromObject} from '../util';
interface Input {
tiles: {[key: string]: string};
collision: string[];
layers: string[][][];
tiles: {[key: string]: string};
collision: string[];
layers: string[][][];
}
export default class MapData {
tiles: Map<string, string>;
collision: string[];
layers: string[][][];
public tiles: Map<string, string>;
public collision: string[];
public layers: string[][][];
width: number;
height: number;
public width: number;
public height: number;
constructor(data: Input) {
this.tiles = mapFromObject(data.tiles);
this.collision = data.collision;
this.layers = data.layers;
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;
}
this.height = this.collision.length;
this.width = this.collision[0].length;
}
}