예제 #1
0
        public bool ConditionMet(Enums.Symbol playerSymbol, IGameBoard board)
        {
            var met = true;

            for (var i = 0; i < board.Size; i++)
            {
                if (board.Get(i, i) != playerSymbol)
                {
                    met = false;
                    break;
                }
            }

            if (met)
            {
                return(true);
            }

            met = true;
            var j = 0;

            for (var i = board.Size - 1; i >= 0; i--)
            {
                if (board.Get(j, i) != playerSymbol)
                {
                    met = false;
                    break;
                }
                j++;
            }

            return(met);
        }
예제 #2
0
        public bool ConditionMet(Enums.Symbol playerSymbol, IGameBoard board)
        {
            for (var x = 0; x < board.Size; x++)
            {
                for (var y = 0; y < board.Size; y++)
                {
                    if (board.Get(x, y) == Enums.Symbol.Empty)
                    {
                        return(false);
                    }
                }
            }

            return(true);
        }
예제 #3
0
 public bool ConditionMet(Enums.Symbol playerSymbol, IGameBoard board)
 {
     for (var column = 0; column < board.Size; column++)
     {
         var met = true;
         for (var row = 0; row < board.Size; row++)
         {
             met = met && board.Get(column, row) == playerSymbol;
         }
         if (met)
         {
             return(true);
         }
     }
     return(false);
 }
예제 #4
0
 public bool InvalidMove(IGameBoard board, CellCord cellCord)
 {
     return(board.Get(cellCord.X, cellCord.Y) != Enums.Symbol.Empty);
 }