From 266d627597b9e241f9a2c0e2b17c1ab413a577c6 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 9 Nov 2018 15:12:26 +0100 Subject: Use Record type where applicable --- src/util.ts | 6 +++--- src/view/input/gameinput.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/util.ts b/src/util.ts index 29c707e..73e30d0 100644 --- a/src/util.ts +++ b/src/util.ts @@ -1,8 +1,8 @@ -export function mapFromObject(obj: {[key: string]: T}): Map { +export function recordToMap(r: Record): Map { const ret = new Map(); - for (const k of Object.keys(obj)) - ret.set(k, obj[k]); + for (const k of Object.keys(r)) + ret.set(k, r[k]); return ret; } diff --git a/src/view/input/gameinput.ts b/src/view/input/gameinput.ts index f3066e3..67fbe0c 100644 --- a/src/view/input/gameinput.ts +++ b/src/view/input/gameinput.ts @@ -10,7 +10,7 @@ export enum ButtonCode { Menu, } -const buttonMapping: {[key: string]: ButtonCode} = { +const buttonMapping: Record = { KeyZ: ButtonCode.Action, KeyX: ButtonCode.Back, KeyC: ButtonCode.Menu, -- cgit v1.2.3