public void IfSearchIsEmpty_BoardIsValid()
        {
            IGamePiece[,] mockBoard = new IGamePiece[, ] {
                { new GamePiece(0, 0), new GamePiece(0, 0), new GamePiece(0, 0), new GamePiece(0, 0) },
                { new GamePiece(0, 0), new GamePiece(1, 0), new GamePiece(0, 0), new GamePiece(0, 0) },
                { new GamePiece(0, 0), new GamePiece(2, 0), new GamePiece(0, 0), new GamePiece(0, 0) },
                { new GamePiece(0, 0), new GamePiece(3, 0), new GamePiece(0, 0), new GamePiece(0, 0) }
            };

            MonsterManager.GetCurrentMonsterCombos().Returns(new List <List <int> >());

            bool isOnBoard = systemUnderTest.IsMonsterComboAvailableOnBoard(mockBoard);

            Assert.IsTrue(isOnBoard);
        }
Ejemplo n.º 2
0
        public bool IsMonsterComboAvailableOnBoard(IGamePiece[,] i_board)
        {
            List <List <int> > combosToCheck = MonsterManager.GetCurrentMonsterCombos();

            if (combosToCheck == null || combosToCheck.Count == 0)
            {
                return(true);    // this doesn't feel like clean code, but if the combosToCheck is null/0, we don't want to randomize
            }

            bool doesBoardHaveAnyCombo = false;

            foreach (List <int> combo in combosToCheck)
            {
                if (IsComboOnBoard(combo, i_board))
                {
                    doesBoardHaveAnyCombo = true;
                    break;
                }
            }

            return(doesBoardHaveAnyCombo);
        }