コード例 #1
0
ファイル: Invoker.cs プロジェクト: wertkh32/gg
 private bool IsUndoableCommand(Command cmd)
 {
     IUndoable undoObject = cmd as IUndoable;
     if (undoObject != null)
     {
         return true;
     }
     else
     {
         return false;
     }
 }
コード例 #2
0
ファイル: Invoker.cs プロジェクト: wertkh32/gg
 private GGResult ExecuteAndPushToStack(string userCommand, Command cmd)
 {
     GGResult result = cmd.Execute(userCommand, ggList);
     if (cmd.GetIsSuccessful() && IsUndoableCommand(cmd))
     {
         undoableCommands.Push((IUndoable)cmd);
     }
     return result;
 }