public BTRoot CreateBehaviourTree( int iId ) { if( iId <= 0 ) { return null; } BTRoot root = new BTRoot( iId ); if (null == m_Config) { m_Config = ConfigManager.Instance.GetAIConfigTable(); } ParseBTXml(root, m_Config); return root; }
public BTRoot CreateBehaviourTree(int iId) { if (iId <= 0) { return(null); } BTRoot root = new BTRoot(iId); if (null == m_Config) { m_Config = ConfigManager.Instance.GetAIConfigTable(); } ParseBTXml(root, m_Config); return(root); }
private void ParseBTXml( BTRoot root, XElement xml ) { IEnumerable<XElement> behaviorTrees = xml.Elements( BTDataKey.BEHAVIOUR_TREE_ROOT ); if( null == behaviorTrees ) { return; } foreach( XElement element in behaviorTrees ) { int iID = 0; int.TryParse( element.Attribute( BTDataKey.BEHAVIOUR_TREE_ID ).Value, out iID ); if( iID != root.ID ) { continue; } ParseBTNode( root, element ); break; } }
private void ParseBTXml(BTRoot root, XElement xml) { IEnumerable <XElement> behaviorTrees = xml.Elements(BTDataKey.BEHAVIOUR_TREE_ROOT); if (null == behaviorTrees) { return; } foreach (XElement element in behaviorTrees) { int iID = 0; int.TryParse(element.Attribute(BTDataKey.BEHAVIOUR_TREE_ID).Value, out iID); if (iID != root.ID) { continue; } ParseBTNode(root, element); break; } }
public AIAgent( int iId ) { m_Root = BehaviourTreeParser.Instance.CreateBehaviourTree( iId ); }
public AIAgent(int iId) { m_Root = BehaviourTreeParser.Instance.CreateBehaviourTree(iId); }