Beispiel #1
0
 /// <summary>
 /// This method is only called when the screen is active and allows
 /// the screen to handle user input.
 /// </summary>
 /// <param name="input"></param>
 public virtual void HandleInput(InputState input)
 {
 }
Beispiel #2
0
        public override void HandleInput(InputState input)
        {
            if(input == null)
            {
                throw new ArgumentNullException("input");
            }

            if (input.IsPauseGame(ControllingPlayer))
            {
                MessageBoxScreen messageBox = new MessageBoxScreen("Would you like to quit?");
                messageBox.Accepted += QuitMessageBoxAccepted;
                ScreenManager.AddScreen(messageBox, ControllingPlayer);
            }

            if (input.IsSelectLeft(ControllingPlayer))
            {
                board.SelectLeft();
            }

            if (input.IsSelectRight(ControllingPlayer))
            {
                board.SelectRight();
            }

            if (input.IsSelectUp(ControllingPlayer))
            {
                board.SelectUp();
            }

            if (input.IsSelectDown(ControllingPlayer))
            {
                board.SelectDown();
            }

            if (input.IsSwapLeft(ControllingPlayer))
            {
                board.SwapLeft();

            }

            if (input.IsSwapRight(ControllingPlayer))
            {
                board.SwapRight();
                board.SwapLeft();
            }

            if (input.IsSwapUp(ControllingPlayer))
            {
                board.SwapUp();
            }

            if (input.IsSwapDown(ControllingPlayer))
            {
                board.SwapDown();
            }

            if (input.IsTurnLeft(ControllingPlayer))
            {
                camera.TurnBoard(Camera.ShiftState.Left);
            }

            if(input.IsTurnRight(ControllingPlayer) || input.IsTurnDefault(ControllingPlayer))
            {
                camera.TurnBoard(Camera.ShiftState.Right);
            }

            if (input.IsTurnUp(ControllingPlayer))
            {
                camera.TurnBoard(Camera.ShiftState.Up);
            }

            if (input.IsTurnDown(ControllingPlayer))
            {
                camera.TurnBoard(Camera.ShiftState.Down);
            }
        }