}
public void restore(SavePoint sp) {
game.flushEventQueue();
game.getEventBus().unregister(operationRecorder);
Undoable target = sp.getOperation();
//assert target == null || operations.contains(target);
while (operations.peekLast() != target) {
operations.pollLast().undo(game);
}
int i = 0;