public void UndoUntilMarker(CommandMarkerType mt) { if (UndoStack.Count == 0) { return; } CommandBase com; Boolean KeepGoing = true; do { com = UndoStack.Pop(); com.Undo(MyGame); if (com is CommandMarker) { if (((CommandMarker)com).MyType == mt) { KeepGoing = false; } } if (!SuspendViewUpdates) { com.UpdateViews(MyGame); } } while (KeepGoing && UndoStack.Count > 0); }
public CommandMarker(CommandMarkerType type) { MyType = type; }