Used for representing what actions were pressed at a point in time. This is a bit different than XNA's controller, because this includes timing, is a mix between keyboard and controller, and is a bit easier to use.
Esempio n. 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Controller"/> class.
        /// </summary>
        /// <param name="playerIndex">Index of the player.</param>
        public Controller(PlayerIndex playerIndex)
        {
            this.packet      = new ControllerPacket();
            this.playerIndex = playerIndex;
            this.rumblePack  = new RumblePack(this.playerIndex);

            #region TimerInitiallization
            this.updateCycle           = 0;
            this.previousUpdate        = 0;
            this.lastSelectionMovement = 0;
            this.lastSelect            = 0;
            #endregion

            #region PreviousRecorderInitiallization
            this.previousPause       = false;
            this.previousSelect      = false;
            this.previousSelectDown  = false;
            this.previousSelectLeft  = false;
            this.previousSelectRight = false;
            this.previousSelectUp    = false;
            this.previousGoBack      = false;
            this.previousA           = false;
            this.previousB           = false;
            this.previousX           = false;
            this.previousY           = false;
            this.previousRB          = false;
            this.previousLB          = false;
            #endregion
        }
Esempio n. 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Controller"/> class.
        /// </summary>
        /// <param name="playerIndex">Index of the player.</param>
        public Controller(PlayerIndex playerIndex)
        {
            this.packet = new ControllerPacket();
            this.playerIndex = playerIndex;
            this.rumblePack = new RumblePack(this.playerIndex);

            #region TimerInitiallization
            this.updateCycle = 0;
            this.previousUpdate = 0;
            this.lastSelectionMovement = 0;
            this.lastSelect = 0;
            #endregion

            #region PreviousRecorderInitiallization
            this.previousPause = false;
            this.previousSelect = false;
            this.previousSelectDown = false;
            this.previousSelectLeft = false;
            this.previousSelectRight = false;
            this.previousSelectUp = false;
            this.previousGoBack = false;
            this.previousA = false;
            this.previousB = false;
            this.previousX = false;
            this.previousY = false;
            this.previousRB = false;
            this.previousLB = false;
            #endregion
        }