当前位置: 首页>>代码示例>>C#>>正文


C# IAction.Perform方法代码示例

本文整理汇总了C#中IAction.Perform方法的典型用法代码示例。如果您正苦于以下问题:C# IAction.Perform方法的具体用法?C# IAction.Perform怎么用?C# IAction.Perform使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IAction的用法示例。


在下文中一共展示了IAction.Perform方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: PerformPlayerAction

 public void PerformPlayerAction(IAction a)
 {
     if (CurrentBattleDetails.BattleStatus != BattleStatus.InBattle)
     {
         throw new Exception("The battle is over what the FUCK are you doing!?");
     }
     CurrentBattleDetails.TurnDetails.Add(a.Perform(Player));
     Player.UntargetTile();
     UpdateBattleStatus();
 }
开发者ID:krashtestrich,项目名称:BestGameEver,代码行数:10,代码来源:Game.cs

示例2: TestAction

 private void TestAction(IAction action)
 {
     action.Perform(_document);
     Compare(true);
     action.Reverse(_document);
     Compare(false);
 }
开发者ID:jpiolho,项目名称:sledge,代码行数:7,代码来源:MapObjectActionTests.cs

示例3: Perform

        /// <summary>
        /// Performs the provided action against the turtle
        /// </summary>
        /// <param name="action">IAction - The action instance with which to perform on the turtle</param>
        public void Perform(IAction action)
        {
            if (action == null) return;
            if (_turtle == null) _turtle = new Turtle();

            bool success = action.Perform(_turtle);
            if (success)
            {
                _history.Add(action);

                for (int index = 0; index < _listViews.Count; index ++)
                {
                    _listViews[index].Draw(_turtle);
                    _listViews[index].Print(action.ToString());
                }
            }
        }
开发者ID:J6628426,项目名称:Logo,代码行数:21,代码来源:Conductor.cs

示例4: PerformAction

        /// <summary>
        /// Performs the action, adds it to the history stack, and optionally updates the display lists
        /// </summary>
        /// <param name="name">The name of the action, for history purposes</param>
        /// <param name="action">The action to perform</param>
        public void PerformAction(string name, IAction action)
        {
            try
            {
                action.Perform(this);
            }
            catch (Exception ex)
            {
                var st = new StackTrace();
                var frames = st.GetFrames() ?? new StackFrame[0];
                var msg = "Action exception: " + name + " (" + action + ")";
                foreach (var frame in frames)
                {
                    var method = frame.GetMethod();
                    msg += "\r\n    " + method.ReflectedType.FullName + "." + method.Name;
                }
                Logging.Logger.ShowException(new Exception(msg, ex), "Error performing action");
            }

            var history = new HistoryAction(name, action);
            History.AddHistoryItem(history);
        }
开发者ID:ChristopherHaws,项目名称:sledge,代码行数:27,代码来源:Document.cs


注:本文中的IAction.Perform方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。