summaryrefslogtreecommitdiffstats
path: root/src/view
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2016-01-08 09:00:07 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2016-01-08 09:00:07 +0100
commita2ea4e5ef5233c7373ceeaaccc3d8df72dc6359e (patch)
tree61de354d2e2a098e58340b4e86ad37cf69cd818b /src/view
parent00970b9faa9338817ec3dddced6dadef69d86fe3 (diff)
downloadrpgedit-a2ea4e5ef5233c7373ceeaaccc3d8df72dc6359e.tar
rpgedit-a2ea4e5ef5233c7373ceeaaccc3d8df72dc6359e.zip
Be explicit about return types, fix a few visibilities
Diffstat (limited to 'src/view')
-rw-r--r--src/view/InputHandler.ts4
-rw-r--r--src/view/MapView.ts10
2 files changed, 7 insertions, 7 deletions
diff --git a/src/view/InputHandler.ts b/src/view/InputHandler.ts
index dcfd85d..86d4ec6 100644
--- a/src/view/InputHandler.ts
+++ b/src/view/InputHandler.ts
@@ -7,9 +7,9 @@ import Direction from '../model/Direction';
class InputHandler {
keys: {[key: number]: boolean} = {};
- listeners: (() => void)[] = [];
+ private listeners: (() => void)[] = [];
- private callListeners() {
+ private callListeners(): void {
this.listeners.forEach(l => l());
}
diff --git a/src/view/MapView.ts b/src/view/MapView.ts
index 230ecf3..daab7cb 100644
--- a/src/view/MapView.ts
+++ b/src/view/MapView.ts
@@ -100,7 +100,7 @@ export default class MapView {
});
}
- private setSize() {
+ private setSize(): void {
var e = document.documentElement;
var w = window.innerWidth || e.clientWidth || body.clientWidth;
var h = window.innerHeight || e.clientHeight || body.clientHeight;
@@ -114,7 +114,7 @@ export default class MapView {
this.redraw()
}
- private drawTile(x: number, y: number, tile: HTMLImageElement) {
+ private drawTile(x: number, y: number, tile: HTMLImageElement): void {
if (!tile)
return;
@@ -139,7 +139,7 @@ export default class MapView {
return !!e.transition;
}
- private setOrigin(time: number) {
+ private setOrigin(time: number): Rect {
var origin = entityPosition(this.origin, time);
var w = this.canvas.width;
@@ -156,7 +156,7 @@ export default class MapView {
);
}
- private draw(time: number) {
+ private draw(time: number): void {
this.updateState(time);
this.redrawPending = false;
@@ -204,7 +204,7 @@ export default class MapView {
this.redraw();
}
- redraw() {
+ redraw(): void {
if (this.redrawPending)
return;