Exemplo n.º 1
0
 // Metoda pro ohodnocení možného tahu
 public void EvaluateMove(int row, int col, int newRow, int newCol, GameBoard board, out int moveResult)
 {
     if (board.Position(newRow, newCol) == (int)GameConstants.States.empty)
     {
         /*
          * Console.WriteLine("Moved");
          * board[newRow, newCol] = board[row, col];
          * Empty(row, col);
          */
         board.Move(row, col, newRow, newCol);
         moveResult = (int)GameConstants.MoveResult.Moved;
     }
     else if (board.Occupied(newRow, newCol) && board.Enemy(row, col, newRow, newCol))
     {
         /*
          * Console.WriteLine("Freezed");
          * Freeze(newRow, newCol);
          * Empty(row, col);
          */
         board.Freeze(row, col, newRow, newCol);
         moveResult = (int)GameConstants.MoveResult.Frozen;
     }
     else
     {
         moveResult = (int)GameConstants.MoveResult.Fail;
     }
 }