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