summaryrefslogtreecommitdiffstats
path: root/src/view/MapView.ts
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2016-01-07 20:19:34 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2016-01-07 20:19:34 +0100
commita09b58b54c19673d3b699b069d0c7683053e27d3 (patch)
treed0360ebae6ffd5adaf780684ad428b5c519b154e /src/view/MapView.ts
parentf569eb788f0ac0f5d10e2b83e2f7f3c9cd0b2d68 (diff)
downloadrpgedit-a09b58b54c19673d3b699b069d0c7683053e27d3.tar
rpgedit-a09b58b54c19673d3b699b069d0c7683053e27d3.zip
Simplify entity list
Diffstat (limited to 'src/view/MapView.ts')
-rw-r--r--src/view/MapView.ts10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/view/MapView.ts b/src/view/MapView.ts
index 5523f81..230ecf3 100644
--- a/src/view/MapView.ts
+++ b/src/view/MapView.ts
@@ -75,7 +75,7 @@ export default class MapView {
private entitySprites: {[key: string]: HTMLImageElement};
constructor(private map: MapData,
- private entities: {[key: string]: EntityPosition},
+ private entities: EntityPosition[],
private origin: EntityPosition,
private updateState: (time: number) => void) {
this.canvas = document.createElement('canvas');
@@ -91,7 +91,7 @@ export default class MapView {
this.tiles = tiles;
});
- var entitiesReady = loadEntities(this.getEntities()).then((entities) => {
+ var entitiesReady = loadEntities(this.entities).then((entities) => {
this.entitySprites = entities;
});
@@ -100,10 +100,6 @@ export default class MapView {
});
}
- private getEntities(): EntityPosition[] {
- return _.values<EntityPosition>(this.entities);
- }
-
private setSize() {
var e = document.documentElement;
var w = window.innerWidth || e.clientWidth || body.clientWidth;
@@ -197,7 +193,7 @@ export default class MapView {
var animate = false;
- this.getEntities().forEach(e => {
+ this.entities.forEach(e => {
if (this.drawEntity(e, time))
animate = true;
});