예제 #1
0
    public void MazeCellZHasValidNumberOfWallsTest()
    {
        // Arrange
        MazeCellZ mazeCell = new MazeCellZ();

        // Act and Assert
        mazeCell.RemoveWall(WallIndex.NorthWall);
        Assert.IsTrue(mazeCell.IsValid());

        mazeCell.RemoveWall(WallIndex.EastWall);
        Assert.IsTrue(mazeCell.IsValid());

        mazeCell.RemoveWall(WallIndex.SouthWall);
        Assert.IsTrue(mazeCell.IsValid());

        mazeCell.RemoveWall(WallIndex.WestWall);
        Assert.IsTrue(mazeCell.IsValid());
    }
예제 #2
0
 public void RemoveWall(WallIndex wallIndex)
 {
     if ((int)wallIndex >= 0 && (int)wallIndex < _mazeWalls.Count)
     {
         if (!_mazeWalls[(int)wallIndex].IsOuterBorderWall)
         {
             _mazeCell.RemoveWall(wallIndex);
             _mazeWalls[(int)wallIndex].RemoveWall();
             _mazeWalls[(int)wallIndex].gameObject.SetActive(false);
         }
     }
 }