added record and restore method to MagicGame as convienent wrapper for undoing in a regular and AI game
parent
37c9d5a00e
commit
0a97959943
|
@ -623,6 +623,22 @@ public class MagicGame {
|
|||
undoPoints.addLast(markerAction);
|
||||
}
|
||||
|
||||
public void record() {
|
||||
if (artificial) {
|
||||
startActions();
|
||||
} else {
|
||||
createUndoPoint();
|
||||
}
|
||||
}
|
||||
|
||||
public void restore() {
|
||||
if (artificial) {
|
||||
undoActions();
|
||||
} else {
|
||||
gotoLastUndoPoint();
|
||||
}
|
||||
}
|
||||
|
||||
public void gotoLastUndoPoint() {
|
||||
final MagicAction markerAction = undoPoints.removeLast();
|
||||
MagicAction action;
|
||||
|
|
Loading…
Reference in New Issue