public void WalkButtonState(BoardModel.CompassDirection direction)
 {
     if (!programModeActivated)
     {
         boardManager.boardController.Walk(direction);
     }
     if (programModeActivated)
     {
         programCommands.AddWalkToCommandList(direction);
     }
     boardDisplay.text = boardManager.boardView.UpdateBoardDisplay();
 }
Пример #2
0
    public void test07_Player_Can_Walk_NORTH_SOUTH_EAST_WEST_From_Provider
        (int playPositionX, int playPositionY, int mapSize, bool expectedResult, BoardModel.CompassDirection direction, BoardModel.SquareType mockLevelSquareType)
    {
        //Arrange
        BoardModel m = new BoardModel(mapSize);

        m.map[4, 5] = mockLevelSquareType; //North
        m.map[5, 6] = mockLevelSquareType; //East
        m.map[5, 5] = mockLevelSquareType; //Start Position
        m.map[6, 5] = mockLevelSquareType; //South
        m.map[5, 4] = mockLevelSquareType; //West

        m.playerX = playPositionX;
        m.playerY = playPositionY;

        m.PlayerWalk(direction);

        //Act
        bool result = m.GetLastActionSuccess();

        //Assert
        Assert.AreEqual(expectedResult, result);
    }
Пример #3
0
 public void DirectJump(BoardModel.CompassDirection direction)
 {
     boardManager.boardController.Jump(direction);
     boardDisplay.text = boardManager.boardView.UpdateBoardDisplay();
 }
Пример #4
0
 public void Jump(BoardModel.CompassDirection direction)
 {
     model.PlayerJump(direction);
 }
Пример #5
0
 public void Walk(BoardModel.CompassDirection direction)
 {
     model.PlayerWalk(direction);
 }
Пример #6
0
    public void test09_Player_Can_Jump_From_Provider
        (int playPositionX, int playPositionY, int mapSize, bool expectedResult, BoardModel.SquareType squareType1, BoardModel.SquareType squareType2, BoardModel.CompassDirection direction)
    {
        //Arrange
        BoardModel m = new BoardModel(mapSize);

        m.playerX = playPositionX;
        m.playerY = playPositionY;

        //Setup Map tiles(mock level)
        m.map[3, 3] = squareType1;
        m.map[2, 3] = squareType2;

        m.PlayerJump(direction);

        //Act
        bool result = m.GetLastActionSuccess();

        //Assert
        Assert.AreEqual(expectedResult, result);
    }
Пример #7
0
    public void test08_Out_Of_Bounds_ImpassableVolcano_ImpassablePit_Move
        (int playPositionX, int playPositionY, int mapSize, bool expectedResult, BoardModel.SquareType squareType, BoardModel.CompassDirection direction)
    {
        //Arrange
        BoardModel m = new BoardModel(mapSize);

        m.playerX = playPositionX;
        m.playerY = playPositionY;

        //Out of bounds...
        m.map[2, 3] = squareType;

        m.PlayerWalk(direction);

        //Act
        bool result = m.GetLastActionSuccess();

        //Assert
        Assert.AreEqual(expectedResult, result);
    }
Пример #8
0
 public void AddJumpToCommandList(BoardModel.CompassDirection direction)
 {
     //  programCommands.Add(() => model.PlayerJump(direction));
 }
 /// <summary>
 /// This => is a lambdas expresion. This () signifies method.
 /// </summary>
 /// <param name="direction"></param>
 public void AddWalkToCommandList(BoardModel.CompassDirection direction)
 {
     programCommands.Add(() => model.PlayerWalk(direction));
 }