stepScope.setScore(pickedMoveScope.getScore());
}
}
private void doMove(MoveScope moveScope) {
ScoreDirector scoreDirector = moveScope.getScoreDirector();
Move move = moveScope.getMove();
Move undoMove = move.createUndoMove(scoreDirector);
moveScope.setUndoMove(undoMove);
move.doMove(scoreDirector);
processMove(moveScope);
undoMove.doMove(scoreDirector);
if (assertUndoMoveIsUncorrupted) {
LocalSearchSolverPhaseScope localSearchSolverPhaseScope = moveScope.getLocalSearchStepScope()
.getLocalSearchSolverPhaseScope();
Score undoScore = localSearchSolverPhaseScope.calculateScore();
Score lastCompletedStepScore = localSearchSolverPhaseScope.getLastCompletedStepScope().getScore();
if (!undoScore.equals(lastCompletedStepScore)) {
// First assert that are probably no corrupted score rules.
scoreDirector.assertWorkingScore(undoScore);
throw new IllegalStateException(
"The moveClass (" + move.getClass() + ")'s move (" + move
+ ") probably has a corrupted undoMove (" + undoMove + ")." +
" Or maybe there are corrupted score rules.\n"
+ "Check the Move.createUndoMove(...) method of that Move class" +