public InputBinding(string name, T[] triggers, InputBindingCallback callback, InputTriggerState state) { Name = !string.IsNullOrEmpty(name) ? name : throw new ArgumentNullException(nameof(name)); Callback = callback ?? throw new ArgumentNullException(nameof(callback)); Triggers = triggers; State = state; }
public void Bind(string name, InputBindingCallback callback, InputTriggerState state, T trigger) { if (string.IsNullOrEmpty(name)) { throw new ArgumentNullException(nameof(name)); } if (callback == null) { throw new ArgumentNullException(nameof(callback)); } bindings.Add(new InputBinding <T>(name, new[] { trigger }, callback, state)); }
public void Bind(string name, InputBindingCallback callback, InputTriggerState state, params T[] combination) { if (string.IsNullOrEmpty(name)) { throw new ArgumentNullException(nameof(name)); } if (callback == null) { throw new ArgumentNullException(nameof(callback)); } if (combination.Length < 2) { throw new ArgumentOutOfRangeException(nameof(combination), "atleast 2 triggers are required for combination"); } bindings.Add(new InputBinding <T>(name, combination, callback, state)); }
public void Bind(string name, InputBindingCallback callback, InputTriggerState state, MouseButton trigger) => manager.Bind(name, callback, state, trigger);
public void Bind(string name, InputBindingCallback callback, InputTriggerState state, params MouseButton[] combination) => manager.Bind(name, callback, state, combination);