private Move findMove(String moveName) { for (Move move : moves) { if (move.getMoveName().equals(moveName)) { return move; } } return null; }
private void tryMove(Move move) { State state = problem.getCurrentState(); State next = move.doMove(state); problem.setCurrentState(next); }