Ejemplo n.º 1
0
 @Test
 public void validMoveTest() {
   board.reset();
   // assertTrue(board.validMove(move1));
   // assertTrue(board.validMove(move2));
   assertFalse(board.validMove(move3));
 }
Ejemplo n.º 2
0
 public Map<Point, Tile> getValidMoves(Board board) {
   Map<Point, Tile> moves = new HashMap<Point, Tile>();
   for (Point point : board.getEmptyPoints()) {
     for (Tile tile : getHand()) {
       Map<Point, Tile> move = new HashMap<Point, Tile>();
       move.put(point, tile);
       if (board.validMove(move) == true) {
         moves.put(point, tile);
       }
       move.clear();
     }
   }
   return moves;
 }
Ejemplo n.º 3
0
 public void makeMove(Board board) {
   Map<Point, Tile> map = determineMove(board);
   board.setField(map);
   addPoints(board.getScore(map));
   map.clear();
 }