using System; using System.Collections.Generic; namespace SM.Game.Controls { public class GameKeybindHost { internal Dictionary _actions = new Dictionary(); public GameKeybindHost() { } public GameKeybindHost(GameKeybindList setup) { for (int i = 0; i < setup.Count; i++) { _actions[setup[i].Key] = setup[i].Value; } } public void Setup(string name, Func keyboard = null, Func gameController = null, Func ai = null) { GameKeybind bind; if (_actions.ContainsKey(name)) { bind = _actions[name]; } else { bind = new GameKeybind(); _actions.Add(name, bind); } bind.Keyboard = keyboard; bind.Controller = gameController; bind.AI = ai; } } }