@Test public void validMoveTest() { board.reset(); // assertTrue(board.validMove(move1)); // assertTrue(board.validMove(move2)); assertFalse(board.validMove(move3)); }
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; }
public void makeMove(Board board) { Map<Point, Tile> map = determineMove(board); board.setField(map); addPoints(board.getScore(map)); map.clear(); }