public override void Construct(MyObjectBuilder_BehaviorTreeNode nodeDefinition, MyBehaviorTree.MyBehaviorTreeDesc treeDesc)
        {
            base.Construct(nodeDefinition, treeDesc);

            m_child = MyBehaviorTreeNodeFactory.CreateBTNode(nodeDefinition);
            m_child.Construct(nodeDefinition, treeDesc);
        }
        public override void Construct(MyObjectBuilder_BehaviorTreeNode nodeDefinition, MyBehaviorTree.MyBehaviorTreeDesc treeDesc)
        {
            base.Construct(nodeDefinition, treeDesc);

            var controlBaseNode = (MyObjectBuilder_BehaviorControlBaseNode)nodeDefinition;

            m_children    = new List <MyBehaviorTreeNode>(controlBaseNode.BTNodes.Length);
            m_isMemorable = controlBaseNode.IsMemorable;
            foreach (var ob in controlBaseNode.BTNodes)
            {
                var childInst = MyBehaviorTreeNodeFactory.CreateBTNode(ob);
                childInst.Construct(ob, treeDesc);
                m_children.Add(childInst);
            }
        }
Exemplo n.º 3
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);
            }
        }
Exemplo n.º 4
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);
            }
        }