public static void ExecuteOnToggle(List<Buttons> buttons, GamePadState oldState, GamePadState newState, Utility.Delegate_Paramless execute) { bool isOneToggled = false; foreach (Buttons button in buttons) isOneToggled |= IsButtonToggled(button, oldState, newState); if (isOneToggled) execute(); }
public static void ExecuteOnToggle(List<Keys> keys, KeyboardState oldState, KeyboardState newState, Utility.Delegate_Paramless execute) { bool isOneToggled = false; foreach (Keys key in keys) isOneToggled |= IsKeyToggled(key, oldState, newState) && !IsModifierUsed(newState); if(isOneToggled) execute(); }
public static void ExecuteOnToggle(List<Tuple<Keys, Keys>> keys, KeyboardState oldState, KeyboardState newState, Utility.Delegate_Paramless execute) { bool isOneToggled = false; foreach (Tuple<Keys,Keys> key in keys) isOneToggled |= IsKeyToggled(key.Item2, oldState, newState) && newState.IsKeyDown(key.Item1); if(isOneToggled) execute(); }
public static void ExecuteOnToggle(Buttons button, GamePadState oldState, GamePadState newState, Utility.Delegate_Paramless execute) { if(IsButtonToggled(button, oldState, newState)) execute(); }
public static void ExecuteOnToggle(Keys key, KeyboardState oldState, KeyboardState newState, Utility.Delegate_Paramless execute) { if(IsKeyToggled(key, oldState, newState)) execute(); }