private bool IsUndoableCommand(Command cmd) { IUndoable undoObject = cmd as IUndoable; if (undoObject != null) { return true; } else { return false; } }
private GGResult ExecuteAndPushToStack(string userCommand, Command cmd) { GGResult result = cmd.Execute(userCommand, ggList); if (cmd.GetIsSuccessful() && IsUndoableCommand(cmd)) { undoableCommands.Push((IUndoable)cmd); } return result; }