示例#1
0
 protected override void load(int version, string agentType, List <property_t> properties)
 {
     base.load(version, agentType, properties);
     if (properties.get_Count() > 0)
     {
         using (List <property_t> .Enumerator enumerator = properties.GetEnumerator())
         {
             while (enumerator.MoveNext())
             {
                 property_t current = enumerator.get_Current();
                 if (current.name == "Domains")
                 {
                     this.m_domains = current.value;
                 }
                 else if (current.name == "DescriptorRefs")
                 {
                     this.m_descriptorRefs = (List <BehaviorTree.Descriptor_t>)StringUtils.FromString(typeof(List <BehaviorTree.Descriptor_t>), current.value, false);
                     if (this.m_descriptorRefs != null)
                     {
                         for (int i = 0; i < this.m_descriptorRefs.get_Count(); i++)
                         {
                             BehaviorTree.Descriptor_t descriptor_t = this.m_descriptorRefs.get_Item(i);
                             if (descriptor_t.Descriptor != null)
                             {
                                 descriptor_t.Descriptor.SetDefaultValue(descriptor_t.Reference);
                             }
                         }
                     }
                 }
             }
         }
     }
 }
示例#2
0
 private static Property FindProperty(Descriptor_t q, List <BehaviorTree.Descriptor_t> c)
 {
     for (int i = 0; i < c.Count; i++)
     {
         BehaviorTree.Descriptor_t _t = c[i];
         if (_t.Descriptor.GetVariableId() == q.Attribute.GetVariableId())
         {
             return(_t.Descriptor);
         }
     }
     return(null);
 }
示例#3
0
 public void SetDescriptors(string descriptors)
 {
     this.m_descriptorRefs = (List <BehaviorTree.Descriptor_t>)StringUtils.FromString(typeof(List <BehaviorTree.Descriptor_t>), descriptors, false);
     if (this.m_descriptorRefs != null)
     {
         for (int i = 0; i < this.m_descriptorRefs.get_Count(); i++)
         {
             BehaviorTree.Descriptor_t descriptor_t = this.m_descriptorRefs.get_Item(i);
             descriptor_t.Descriptor.SetDefaultValue(descriptor_t.Reference);
         }
     }
 }
示例#4
0
 private static Property FindProperty(Query.Descriptor_t q, List <BehaviorTree.Descriptor_t> c)
 {
     for (int i = 0; i < c.get_Count(); i++)
     {
         BehaviorTree.Descriptor_t descriptor_t = c.get_Item(i);
         if (descriptor_t.Descriptor.GetVariableId() == q.Attribute.GetVariableId())
         {
             return(descriptor_t.Descriptor);
         }
     }
     return(null);
 }
示例#5
0
        static Property FindProperty(Descriptor_t q, List <BehaviorTree.Descriptor_t> c)
        {
            //BehaviorTree.Descriptor_t descriptor = c.Find(delegate (BehaviorTree.Descriptor_t it) { return it.Descriptor.GetVariableId() == q.Attribute.GetVariableId(); });
            for (int i = 0; i < c.Count; ++i)
            {
                BehaviorTree.Descriptor_t descriptor = c[i];
                if (descriptor.Descriptor.GetVariableId() == q.Attribute.GetVariableId())
                {
                    return(descriptor.Descriptor);
                }
            }

            return(null);
        }
示例#6
0
 public Descriptor_t(BehaviorTree.Descriptor_t copy)
 {
     this.Descriptor = (copy.Descriptor == null) ? null : copy.Descriptor.clone();
     this.Reference  = (copy.Reference == null) ? null : copy.Reference.clone();
 }
 public Descriptor_t(BehaviorTree.Descriptor_t copy)
 {
     this.Descriptor = ((copy.Descriptor != null) ? copy.Descriptor.clone() : null);
     this.Reference  = ((copy.Reference != null) ? copy.Reference.clone() : null);
 }