示例#1
0
 public void Update(GameTime gameTime)
 {
     foreach (var inputListener in InputListeners.ToArray())
     {
         inputListener.Update(gameTime);
     }
 }
示例#2
0
        public bool TryGetListener <TType>(out TType value) where TType : IInputListener
        {
            value = default;

            var first = InputListeners.FirstOrDefault(x => typeof(TType) == x.GetType());

            if (first != default)
            {
                value = (TType)first;
                return(true);
            }

            return(false);
        }
示例#3
0
 public bool IsPressed(InputCommand command)
 {
     return(InputListeners.Any(l => l.IsPressed(command)));
 }
示例#4
0
 public bool IsBeginPress(InputCommand command)
 {
     return(InputListeners.Any(l => l.IsBeginPress(command)));
 }
示例#5
0
 public bool IsDown(InputCommand command)
 {
     return(InputListeners.Any(l => l.IsDown(command)));
 }
示例#6
0
 public void AddListener(IInputListener listener)
 {
     InputListeners.Add(listener);
 }
示例#7
0
        public void AddListener(IInputListener listener)
        {
            InputListeners.Add(listener);

            InputListenerAdded?.Invoke(this, new InputListenerAdded(listener));
        }