/// <summary> /// Lisää callbackin /// </summary> /// <param name="callback">Callback</param> public void AddAction(GamepadInputCallback callback) { if (!callbacks.Contains(callback)) { callbacks.Add(callback); } else { Debug.WriteLine("Yritettiin lisätä olemassa olevaa callbackkia bindaukselle {0}", Name); } }
/// <summary> /// Lisää callbackin /// </summary> /// <param name="callback">Callback</param> public void AddAction(GamepadInputCallback callback) { if (!callbacks.Contains(callback)) { callbacks.Add(callback); } else { Debug.WriteLine("Yritettiin lisätä olemassa olevaa callbackkia bindaukselle {0}", Name); } }
public void Map(ButtonTrigger trigger, GamepadInputCallback callback) { if (!Bindings.ContainsKey(trigger.Name)) { GamepadBinding binding = new GamepadBinding(trigger.Name); Bindings.Add(trigger.Name, binding); Bindings[trigger.Name].AddAction(callback); } Buttons[] buttons = new Buttons[1 + trigger.AlternateButtons.Length]; buttons[0] = trigger.Button; for (int i = 0, j = 1; i < trigger.AlternateButtons.Length; i++, j++) { buttons[j] = trigger.AlternateButtons[i]; } buttonBinds.Add(trigger.Name, buttons); }
public void Map(ButtonTrigger trigger, GamepadInputCallback callback) { if (!Bindings.ContainsKey(trigger.Name)) { GamepadBinding binding = new GamepadBinding(trigger.Name); Bindings.Add(trigger.Name, binding); Bindings[trigger.Name].AddAction(callback); } Buttons[] buttons = new Buttons[1 + trigger.AlternateButtons.Length]; buttons[0] = trigger.Button; for (int i = 0, j = 1; i < trigger.AlternateButtons.Length; i++, j++) { buttons[j] = trigger.AlternateButtons[i]; } buttonBinds.Add(trigger.Name, buttons); }