Ejemplo n.º 1
0
 /// <summary>
 /// Raises the ThumbstickMoved event. This is automatically raised by an appropriately configured
 /// GamePadEvents object, but this allows for programmatic raising of events.
 /// </summary>
 public void OnThumbstickMoved(object sender, GamePadThumbstickEventArgs args)
 {
     if (ThumbstickMoved != null)
     {
         ThumbstickMoved(sender, args);
     }
 }
Ejemplo n.º 2
0
        private GamePadThumbstickEventArgs GetGamePadThumbStickEventArgs(TimeSpan time, PlayerIndex logicalIndex, Thumbsticks stick, Vector2 position, GamePadState state)
        {
            GamePadThumbstickEventArgs _arg;

            if (_freeGPTEventArgs.Count == 0)
            { //If it doesn't exist
                _arg = new GamePadThumbstickEventArgs(time, logicalIndex, stick, position, state);
                _allGPTEventArgs.Add(_arg);
                return(_arg);
            }

            //If it exists
            _arg = _freeGPTEventArgs[_freeGPTEventArgs.Count - 1];
            _freeGPTEventArgs.RemoveAt(_freeGPTEventArgs.Count - 1);

            _arg.Time         = time;
            _arg.Position     = position;
            _arg.Thumbstick   = stick;
            _arg.LogicalIndex = logicalIndex;
            _arg.Current      = state;

            return(_arg);
        }