Exemplo n.º 1
0
 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;
 }
Exemplo n.º 2
0
        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));
        }
Exemplo n.º 3
0
        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));
        }
Exemplo n.º 4
0
 public void Bind(string name, InputBindingCallback callback, InputTriggerState state, MouseButton trigger)
 => manager.Bind(name, callback, state, trigger);
Exemplo n.º 5
0
 public void Bind(string name, InputBindingCallback callback, InputTriggerState state, params MouseButton[] combination)
 => manager.Bind(name, callback, state, combination);