/// <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 BrainsPacket(); this.previousPacket = new BrainsPacket(); this.playerIndex = 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; #endregion }
/// <summary> /// Copies the specified other packet to this packet. /// </summary> /// <param name="otherPacket">The other packet.</param> public void Copy(BrainsPacket otherPacket) { this.Select = otherPacket.Select; this.SelectionDown = otherPacket.SelectionDown; this.SelectionLeft = otherPacket.SelectionLeft; this.SelectionRight = otherPacket.SelectionRight; this.SelectionUp = otherPacket.SelectionUp; this.GoBack = otherPacket.GoBack; this.XButton = otherPacket.XButton; this.YButton = otherPacket.YButton; this.AButton = otherPacket.AButton; this.BButton = otherPacket.BButton; this.RightBumper = otherPacket.RightBumper; this.LeftBumper = otherPacket.LeftBumper; this.Pause = otherPacket.Pause; this.DPadDown = otherPacket.DPadDown; this.DPadLeft = otherPacket.DPadLeft; this.DPadRight = otherPacket.DPadRight; this.DPadUp = otherPacket.DPadUp; this.MoveHorizontal = otherPacket.MoveHorizontal; this.MoveVertical = otherPacket.MoveVertical; this.LookHorizontal = otherPacket.LookHorizontal; this.LookVertical = otherPacket.LookVertical; this.RightTrigger = otherPacket.RightTrigger; this.LeftTrigger = otherPacket.LeftTrigger; }