Ejemplo n.º 1
0
        public override void Construct(MyObjectBuilder_BehaviorTreeNode nodeDefinition, MyBehaviorTree.MyBehaviorTreeDesc treeDesc)
        {
            base.Construct(nodeDefinition, treeDesc);

            m_child = MyBehaviorTreeNodeFactory.CreateBTNode(nodeDefinition);
            m_child.Construct(nodeDefinition, treeDesc);
        }
        void RecordRunningNodeName(MyBehaviorTreeState state, MyBehaviorTreeNode node)
        {
            if (!Sandbox.Engine.Utils.MyDebugDrawSettings.DEBUG_DRAW_BOTS)
            {
                return;
            }

            m_runningActionName = "";
            if (state == MyBehaviorTreeState.RUNNING)
            {
                if (node is MyBehaviorTreeActionNode)
                {
                    MyBehaviorTreeActionNode action = (MyBehaviorTreeActionNode)node;
                    m_runningActionName = action.GetActionName();
                }
                else
                {
                    string str = node.m_runningActionName;
                    if (str.Contains(ParentName))
                    {
                        str = str.Replace(ParentName, m_name + "-");
                    }
                    m_runningActionName = str;
                }
            }
        }
Ejemplo n.º 3
0
        public override void Construct(MyObjectBuilder_BehaviorTreeNode nodeDefinition, MyBehaviorTree.MyBehaviorTreeDesc treeDesc)
        {
            base.Construct(nodeDefinition, treeDesc);

            m_child = MyBehaviorTreeNodeFactory.CreateBTNode(nodeDefinition);
            m_child.Construct(nodeDefinition, treeDesc);
        }
Ejemplo n.º 4
0
        public override void Construct(MyObjectBuilder_BehaviorTreeNode nodeDefinition, MyBehaviorTree.MyBehaviorTreeDesc treeDesc)
        {
            base.Construct(nodeDefinition, treeDesc);
            MyObjectBuilder_BehaviorControlBaseNode node = (MyObjectBuilder_BehaviorControlBaseNode)nodeDefinition;

            this.m_children    = new List <MyBehaviorTreeNode>(node.BTNodes.Length);
            this.m_isMemorable = node.IsMemorable;
            this.m_name        = node.Name;
            foreach (MyObjectBuilder_BehaviorTreeNode node2 in node.BTNodes)
            {
                MyBehaviorTreeNode item = MyBehaviorTreeNodeFactory.CreateBTNode(node2);
                item.Construct(node2, treeDesc);
                this.m_children.Add(item);
            }
        }
Ejemplo n.º 5
0
        public override void Construct(MyObjectBuilder_BehaviorTreeNode nodeDefinition, MyBehaviorTree.MyBehaviorTreeDesc treeDesc)
        {
            base.Construct(nodeDefinition, treeDesc);
            MyObjectBuilder_BehaviorTreeDecoratorNode node = nodeDefinition as MyObjectBuilder_BehaviorTreeDecoratorNode;

            this.m_defaultReturnValue = (MyBehaviorTreeState)((sbyte)node.DefaultReturnValue);
            this.m_decoratorLogicName = node.DecoratorLogic.GetType().Name;
            this.m_decoratorLogic     = GetDecoratorLogic(node.DecoratorLogic);
            this.m_decoratorLogic.Construct(node.DecoratorLogic);
            if (node.BTNode != null)
            {
                this.m_child = MyBehaviorTreeNodeFactory.CreateBTNode(node.BTNode);
                this.m_child.Construct(node.BTNode, treeDesc);
            }
        }
        public override void Construct(MyObjectBuilder_BehaviorTreeNode nodeDefinition, MyBehaviorTree.MyBehaviorTreeDesc treeDesc)
        {
            base.Construct(nodeDefinition, treeDesc);
            var ob = nodeDefinition as MyObjectBuilder_BehaviorTreeDecoratorNode;

            m_defaultReturnValue = (MyBehaviorTreeState)((byte)ob.DefaultReturnValue);
            m_decoratorLogicName = ob.DecoratorLogic.GetType().Name;

            m_decoratorLogic = GetDecoratorLogic(ob.DecoratorLogic);
            m_decoratorLogic.Construct(ob.DecoratorLogic);

            if (ob.BTNode != null)
            {
                m_child = MyBehaviorTreeNodeFactory.CreateBTNode(ob.BTNode);
                m_child.Construct(ob.BTNode, treeDesc);
            }
        }
        void RecordRunningNodeName(MyBehaviorTreeState state, MyBehaviorTreeNode node)
        {
            if (!Sandbox.Engine.Utils.MyDebugDrawSettings.DEBUG_DRAW_BOTS)
                return;

            m_runningActionName = "";
            if (state == MyBehaviorTreeState.RUNNING)
            {
                if (node is MyBehaviorTreeActionNode)
                {
                    MyBehaviorTreeActionNode action = (MyBehaviorTreeActionNode)node;
                    m_runningActionName = action.GetActionName();
                }
                else
                {
                    string str = node.m_runningActionName;
                    if (str.Contains(ParentName))
                        str = str.Replace(ParentName, m_name + "-");
                    m_runningActionName = str;
                }
            }
        }
Ejemplo n.º 8
0
 private void RecordRunningNodeName(MyBehaviorTreeState state, MyBehaviorTreeNode node)
 {
     if (MyDebugDrawSettings.DEBUG_DRAW_BOTS)
     {
         base.m_runningActionName = "";
         if (state == MyBehaviorTreeState.RUNNING)
         {
             if (node is MyBehaviorTreeActionNode)
             {
                 base.m_runningActionName = ((MyBehaviorTreeActionNode)node).GetActionName();
             }
             else
             {
                 string runningActionName = node.m_runningActionName;
                 if (runningActionName.Contains("Par_N"))
                 {
                     runningActionName = runningActionName.Replace("Par_N", this.m_name + "-");
                 }
                 base.m_runningActionName = runningActionName;
             }
         }
     }
 }
Ejemplo n.º 9
0
 public void Construct()
 {
     ClearData();
     m_root = new MyBehaviorTreeRoot();
     m_root.Construct(m_behaviorDefinition.FirstNode, m_treeDesc);
 }
 public MyBehaviorTreeDecoratorNode()
 {
     m_child          = null;
     m_decoratorLogic = null;
 }
Ejemplo n.º 11
0
        public void ProcessLastRunningNode(MyBehaviorTreeNode node)
        {
            if (LastRunningNodeIndex == -1)
                return;

            if (LastRunningNodeIndex != node.MemoryIndex)
            {
                PostTickOldPath();
            }
            else
            {
                ClearOldPath();
            }
        }
Ejemplo n.º 12
0
 public void Construct()
 {
     ClearData();
     m_root = new MyBehaviorTreeRoot();
     m_root.Construct(m_behaviorDefinition.FirstNode, m_treeDesc);
 }
 public MyBehaviorTreeDecoratorNode()
 {
     m_child = null;
     m_decoratorLogic = null;
 }
 public static MyObjectBuilder_BehaviorTreeNode CreateObjectBuilder(MyBehaviorTreeNode cubeBlock)
 {
     return m_objectFactory.CreateObjectBuilder<MyObjectBuilder_BehaviorTreeNode>(cubeBlock);
 }
 public static MyObjectBuilder_BehaviorTreeNode CreateObjectBuilder(MyBehaviorTreeNode cubeBlock)
 {
     return(m_objectFactory.CreateObjectBuilder <MyObjectBuilder_BehaviorTreeNode>(cubeBlock));
 }