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


C# IAgentData.GetTaskData方法代码示例

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


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

示例1: Update

        /// <summary>
        ///   Per frame update.
        /// </summary>
        /// <param name="agentData"> Agent data. </param>
        /// <returns> Execution status after this update. </returns>
        public override ExecutionStatus Update(IAgentData agentData)
        {
            Data data = agentData.GetTaskData<Data>();
            if (data.Status == ExecutionStatus.Running)
            {
                // Update.
                data.Status = this.UpdateChild(agentData);
            }
            else
            {
                // Restart if still possible.
                IDecisionData decisionData = null;
                ++agentData.CurrentDeciderLevel;
                float decisionValue = this.Task.Decide(agentData, ref decisionData);
                --agentData.CurrentDeciderLevel;
                if (decisionValue > 0.0f)
                {
                    data.Status = this.ActivateChild(agentData, decisionData);
                    if (data.Status == ExecutionStatus.Running)
                    {
                        data.Status = this.UpdateChild(agentData);
                    }
                }
                else
                {
                    data.Status = ExecutionStatus.Failed;
                }
            }

            return ExecutionStatus.Running;
        }
开发者ID:jixiang111,项目名称:slash-framework,代码行数:36,代码来源:LoopDecorator.cs

示例2: Deactivate

        /// <summary>
        ///   Deactivation.
        /// </summary>
        /// <param name="agentData"> Agent data. </param>
        public override void Deactivate(IAgentData agentData)
        {
            Data data = agentData.GetTaskData<Data>();

            // Deactivate child if running.
            if (data.Status == ExecutionStatus.Running)
            {
                this.DeactivateChild(agentData);
            }

            agentData.CurrentTaskData = null;
        }
开发者ID:jixiang111,项目名称:slash-framework,代码行数:16,代码来源:LoopDecorator.cs

示例3: Deactivate

        /// <summary>
        ///   Deactivation.
        /// </summary>
        /// <param name="agentData"> Agent data. </param>
        public override void Deactivate(IAgentData agentData)
        {
            Data data = agentData.GetTaskData<Data>();

            // Setup blackboard.
            Setup(agentData, data);

            // Deactivate child.
            this.DeactivateChild(agentData);

            // Tear down.
            TearDown(agentData, data);
        }
开发者ID:jixiang111,项目名称:slash-framework,代码行数:17,代码来源:CreateBlackboard.cs

示例4: Update

        /// <summary>
        ///   Per frame update.
        /// </summary>
        /// <param name="agentData"> Agent data. </param>
        /// <returns> Execution status after this update. </returns>
        public override ExecutionStatus Update(IAgentData agentData)
        {
            Data data = agentData.GetTaskData<Data>();

            // Setup blackboard.
            Setup(agentData, data);

            ExecutionStatus result = base.Update(agentData);
            if (result != ExecutionStatus.Running)
            {
                // Tear down.
                TearDown(agentData, data);
            }

            return result;
        }
开发者ID:jixiang111,项目名称:slash-framework,代码行数:21,代码来源:CreateBlackboard.cs


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