public static void WaitForInput() { TCODKey rawKey = TCODConsole.waitForKeypress(true); Key key = new Key(rawKey); if (events.Keys.Contains(key)) { foreach (Action a in events[key]) a(); } }
public static void RegisterInputEvent(Key key, Action keyEvent) { List<Action> actions; if (!events.TryGetValue(key, out actions)) { actions = new List<Action>(); events[key] = actions; } events[key].Add(keyEvent); }
public static Key WaitForAndReturnInput() { TCODKey rawKey = TCODConsole.waitForKeypress(true); Key key = new Key(rawKey); return key; }
public static void RegisterInputEvent(Key[] keys, Action action) { foreach (Key k in keys) RegisterInputEvent(k, action); }