Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/customer/www/qualgame.com/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340
Mono Behavior Node Management | BtEngineSDK

Mono Behavior Node Management

Table of contents

1. Register a mono behavior node
2. Register all existing mono behavior nodes by name
3. Determine whether a mono behavior node is registered
4. Find a mono behavior node
5. Deregister a mono behavior node
6. Deregister all mono behavior nodes
7. Get the number of registered mono behavior nodes
8. Get the IEnumerable interface to all registered mono behavior nodes

1. Register a mono behavior node
1.1. Register a “forest” mono behavior node
Signature:
static Tuple<bool, MonoBehaviorNodeBase> BtEngine.MonoBehaviorNode.Register(uint ForestIndex, MonoBehaviorNodeBase MBNode)
Description:
Registers a “forest” mono behavior node associated with the specified (forest) index for searching and invoking node operations. If an association for the specified (forest) index was present, the old mono behavior node is replaced.
Parameters:
ForestIndex The forest index of the mono behavior node to register.
MBNode The mono behavior node to register.
Return Value:
A tuple. Item1: true if an association for the specified (forest) index was present; false otherwise. Item2: the previous mono behavior node associated with the specified (forest) index if Item1 is true; null otherwise.
Complexity:
O(log f), where f is the count of registered “forest” mono behavior node.
1.2. Register a “tree root” mono behavior node
Signature:
static Tuple<bool, MonoBehaviorNodeBase> BtEngine.MonoBehaviorNode.Register(uint ForestIndex, uint TreeIndex, MonoBehaviorNodeBase MBNode)
Description:
Registers a “tree root” mono behavior node associated with the specified (forest, tree) indices for searching and invoking node operations. If an association for the specified (forest, tree) indices was present, the old mono behavior node is replaced.
Parameters:
ForestIndex The forest index of the mono behavior node to register.
TreeIndex The tree index of the mono behavior node to register.
MBNode The mono behavior node to register.
Return Value:
A tuple. Item1: true if an association for the specified (forest, tree) indices was present; false otherwise. Item2: the previous mono behavior node associated with the specified (forest, tree) indices if Item1 is true; null otherwise.
Complexity:
O(log f + log t), where f is the count of registered “forest” mono behavior node and t is the count of whose child registered “tree root” mono behavior node.
1.3. Register a “decorator”, “condition” or “action” mono behavior node
Signature:
static Tuple<bool, MonoBehaviorNodeBase> BtEngine.MonoBehaviorNode.Register(uint ForestIndex, uint TreeIndex, uint NodeIndex, MonoBehaviorNodeBase MBNode)
Description:
Registers a “decorator”, “condition” or “action” mono behavior node associated with the specified (forest, tree, node) indices for searching and invoking node operations. If an association for the specified (forest, tree, node) indices was present, the old mono behavior node is replaced.
Parameters:
ForestIndex The forest index of the mono behavior node to register.
TreeIndex The tree index of the mono behavior node to register.
NodeIndex The node index of the mono behavior node to register.
MBNode The mono behavior node to register.
Return Value:
A tuple. Item1: true if an association for the specified (forest, tree, node) indices was present; false otherwise. Item2: the previous mono behavior node associated with the specified (forest, tree, node) indices if Item1 is true; null otherwise.
Complexity:
O(log f + log t + log n), where f is the count of registered “forest” mono behavior node, t is the count of whose child registered “tree root” mono behavior node and n is the count of whose child registered “decorator”, “condition” and “action” mono behavior node.
2. Register all existing mono behavior nodes by name
Signature:
static bool BtEngine.MonoBehaviorNode.RegisterAllByName()
Description:
Registers all existing mono behavior nodes that were registered by their indices with their names. This method effectively builds a name-based forest-tree-node hierarchical structure of existing mono behavior nodes for searching and invoking node operations by their names.
Return Value:
True if all existing mono behavior nodes were present, whose names were non-empty strings and were registered by their names successfully; false otherwise.
Complexity:
O(n), where n is the count of all registered mono behavior node.
3. Determine whether a mono behavior node is registered
3.1. Determine whether a “forest” mono behavior node is registered
Signature:
static bool BtEngine.MonoBehaviorNode.IsRegistered(uint ForestIndex)
static bool BtEngine.MonoBehaviorNode.IsRegistered(string ForestName)
Description:
Determines whether a “forest” mono behavior node associated with the specified (forest) index/name is registered.
Parameters:
ForestIndex The forest index of the mono behavior node whose presence is to be determined.
ForestName The forest name of the mono behavior node whose presence is to be determined.
Return Value:
True if an association for the specified (forest) index/name was present; false otherwise.
Complexity:
Index-based: O(log f), where f is the count of registered “forest” mono behavior node. Name-based: O(1).
3.2. Determine whether a “tree root” mono behavior node is registered
Signature:
static bool BtEngine.MonoBehaviorNode.IsRegistered(uint ForestIndex, uint TreeIndex)
static bool BtEngine.MonoBehaviorNode.IsRegistered(string ForestName, string TreeName)
Description:
Determines whether a “tree root” mono behavior node associated with the specified (forest, tree) indices/names is registered.
Parameters:
ForestIndex The forest index of the mono behavior node whose presence is to be determined.
TreeIndex The tree index of the mono behavior node whose presence is to be determined.
ForestName The forest name of the mono behavior node whose presence is to be determined.
TreeName The tree name of the mono behavior node whose presence is to be determined.
Return Value:
True if an association for the specified (forest, tree) indices/names was present; false otherwise.
Complexity:
Index-based: O(log f + log t), where f is the count of registered “forest” mono behavior node and t is the count of whose child registered “tree root” mono behavior node. Name-based: O(1).
3.3. Determine whether a “decorator”, “condition” or “action” mono behavior node is registered
Signature:
static bool BtEngine.MonoBehaviorNode.IsRegistered(uint ForestIndex, uint TreeIndex, uint NodeIndex)
static bool BtEngine.MonoBehaviorNode.IsRegistered(string ForestName, string TreeName, string NodeName)
Description:
Determines whether a “decorator”, “condition” or “action” mono behavior node associated with the specified (forest, tree, node) indices/names is registered.
Parameters:
ForestIndex The forest index of the mono behavior node whose presence is to be determined.
TreeIndex The tree index of the mono behavior node whose presence is to be determined.
NodeIndex The node index of the mono behavior node whose presence is to be determined.
ForestName The forest name of the mono behavior node whose presence is to be determined.
TreeName The tree name of the mono behavior node whose presence is to be determined.
NodeName The node name of the mono behavior node whose presence is to be determined.
Return Value:
True if an association for the specified (forest, tree, node) indices/names was present; false otherwise.
Complexity:
Index-based: O(log f + log t + log n), where f is the count of registered “forest” mono behavior node, t is the count of whose child registered “tree root” mono behavior node and n is the count of whose child registered “decorator”, “condition” and “action” mono behavior node. Name-based: O(1).
4. Find a mono behavior node
4.1. Find a “forest” mono behavior node
Signature:
static Tuple<bool, MonoBehaviorNodeBase> BtEngine.MonoBehaviorNode.Find(uint ForestIndex)
static Tuple<bool, MonoBehaviorNodeBase> BtEngine.MonoBehaviorNode.Find(string ForestName)
Description:
Finds a “forest” mono behavior node associated with the specified (forest) index/name.
Parameters:
ForestIndex The forest index of the mono behavior node to find.
ForestName The forest name of the mono behavior node to find.
Return Value:
A tuple. Item1: true if an association for the specified (forest) index/name was found; false otherwise. Item2: the mono behavior node associated with the specified (forest) index/name if Item1 is true; null otherwise.
Complexity:
Index-based: O(log f), where f is the count of registered “forest” mono behavior node. Name-based: O(1).
4.2. Find a “tree root” mono behavior node
Signature:
static Tuple<bool, MonoBehaviorNodeBase> BtEngine.MonoBehaviorNode.Find(uint ForestIndex, uint TreeIndex)
static Tuple<bool, MonoBehaviorNodeBase> BtEngine.MonoBehaviorNode.Find(string ForestName, string TreeName)
Description:
Finds a “tree root” mono behavior node associated with the specified (forest, tree) indices/names.
Parameters:
ForestIndex The forest index of the mono behavior node to find.
TreeIndex The tree index of the mono behavior node to find.
ForestName The forest name of the mono behavior node to find.
TreeName The tree name of the mono behavior node to find.
Return Value:
A tuple. Item1: true if an association for the specified (forest, tree) indices/names was found; false otherwise. Item2: the mono behavior node associated with the specified (forest, tree) indices/names if Item1 is true; null otherwise.
Complexity:
Index-based: O(log f + log t), where f is the count of registered “forest” mono behavior node and t is the count of whose child “tree root” mono behavior node. Name-based: O(1).
4.3. Find a “decorator”, “condition” or “action” mono behavior node
Signature:
static Tuple<bool, MonoBehaviorNodeBase> BtEngine.MonoBehaviorNode.Find(uint ForestIndex, uint TreeIndex, uint NodeIndex)
static Tuple<bool, MonoBehaviorNodeBase> BtEngine.MonoBehaviorNode.Find(string ForestName, string TreeName, string NodeName)
Description:
Finds a “decorator”, “condition” or “action” mono behavior node associated with the specified (forest, tree, node) indices/names.
Parameters:
ForestIndex The forest index of the mono behavior node to find.
TreeIndex The tree index of the mono behavior node to find.
NodeIndex The node index of the mono behavior node to find.
ForestName The forest name of the mono behavior node to find.
TreeName The tree name of the mono behavior node to find.
NodeName The node name of the mono behavior node to find.
Return Value:
A tuple. Item1: true if an association for the specified (forest, tree, node) indices/names was found; false otherwise. Item2: the mono behavior node associated with the specified (forest, tree, node) indices/names if Item1 is true; null otherwise.
Complexity:
Index-based: O(log f + log t + log n), where f is the count of registered “forest” mono behavior node, t is the count of whose child registered “tree root” mono behavior node and n is the count of whose child registered “decorator”, “condition” and “action” mono behavior node. Name-based: O(1).
5. Deregister a mono behavior node
5.1. Deregister a “forest” mono behavior node
Signature:
static Tuple<bool, MonoBehaviorNodeBase> BtEngine.MonoBehaviorNode.Deregister(uint ForestIndex)
static Tuple<bool, MonoBehaviorNodeBase> BtEngine.MonoBehaviorNode.Deregister(string ForestName)
Description:
Deregisters a “forest” mono behavior node associated with the specified (forest) index/name. If an association for the specified (forest) index/name was present, it gets removed.
Parameters:
ForestIndex The forest index of the mono behavior node to deregister.
ForestName The forest name of the mono behavior node to deregister.
Return Value:
A tuple. Item1: true if an association for the specified (forest) index/name was present; false otherwise. Item2: the previous mono behavior node associated with specified (forest) index/name if Item1 is true; null otherwise.
Complexity:
Index-based: O(log f), where f is the count of registered “forest” mono behavior node. Name-based: O(1).
5.2. Deregister a “tree root” mono behavior node
Signature:
static Tuple<bool, MonoBehaviorNodeBase> BtEngine.MonoBehaviorNode.Deregister(uint ForestIndex, uint TreeIndex)
static Tuple<bool, MonoBehaviorNodeBase> BtEngine.MonoBehaviorNode.Deregister(string ForestName, string TreeName)
Description:
Deregisters a “tree root” mono behavior node associated with the specified (forest, tree) indices/names. If an association for the specified (forest, tree) indices/names was present, it gets removed.
Parameters:
ForestIndex The forest index of the mono behavior node to deregister.
TreeIndex The tree index of the mono behavior node to deregister.
ForestName The forest name of the mono behavior node to deregister.
TreeName The tree name of the mono behavior node to deregister.
Return Value:
A tuple. Item1: true if an association for the specified (forest, tree) indices/names was present; false otherwise. Item2: the previous mono behavior node associated with specified (forest, tree) indices/names if Item1 is true; null otherwise.
Complexity:
Index-based: O(log f + log t), where f is the count of registered “forest” mono behavior node and t is the count of whose child registered “tree root” mono behavior node. Name-based: O(1).
5.3. Deregister a “decorator”, “condition” or “action” mono behavior node
Signature:
static Tuple<bool, MonoBehaviorNodeBase> BtEngine.MonoBehaviorNode.Deregister(uint ForestIndex, uint TreeIndex, uint NodeIndex)
static Tuple<bool, MonoBehaviorNodeBase> BtEngine.MonoBehaviorNode.Deregister(string ForestName, string TreeName, string NodeName)
Description:
Deregisters a “decorator”, “condition” or “action” mono behavior node associated with the specified (forest, tree, node) indices/names. If an association for the specified (forest, tree, node) indices/names was present, it gets removed.
Parameters:
ForestIndex The forest index of the mono behavior node to deregister.
TreeIndex The tree index of the mono behavior node to deregister.
NodeIndex The node index of the mono behavior node to deregister.
ForestName The forest name of the mono behavior node to deregister.
TreeName The tree name of the mono behavior node to deregister.
NodeName The node name of the mono behavior node to deregister.
Return Value:
A tuple. Item1: true if an association for the specified (forest, tree, node) indices/names was present; false otherwise. Item2: the previous mono behavior node associated with specified (forest, tree, node) indices/names if Item1 is true; null otherwise.
Complexity:
Index-based: O(log f + log t + log n), where f is the count of registered “forest” mono behavior node, t is the count of whose child registered “tree root” mono behavior node and n is the count of whose child registered “decorator”, “condition” and “action” mono behavior node. Name-based: O(1).
6. Deregister all mono behavior nodes
Signature:
static void BtEngine.MonoBehaviorNode.DeregisterAll()
Description:
Deregisters all mono behavior nodes. All associations get removed.
Complexity:
O(1).
7. Get the number of registered mono behavior nodes
Signature:
static uint BtEngine.MonoBehaviorNode.Count()
Description:
Gets the number of registered mono behavior nodes.
Return Value:
The number of associations of index-mono behavior node.
Complexity:
O(1).
8. Get the IEnumerable interface to all registered mono behavior nodes
8.1. Enumerate all registered mono behavior nodes
Signature:
static IEnumerable<Tuple<Tuple<HierarchyNodeType, uint, uint, uint>, MonoBehaviorNodeBase>> BtEngine.MonoBehaviorNode.GetEnumerableByIndex(FromForestTo Level)
static IEnumerable<Tuple<Tuple<HierarchyNodeType, string, string, string>, MonoBehaviorNodeBase>> BtEngine.MonoBehaviorNode.GetEnumerableByName(FromForestTo Level)
Description:
Exposes an enumerator that supports a simple iteration over all registered mono behavior nodes in index/name based depth-first traversal order.
Parameters:
Level The depth level of mono behavior nodes in the hierarchy.
Return Value:
An IEnumerable interface.
Item1.Item1: the hierarchy node type whose associated mono behavior node is to be enumerated.
Item1.Item2: the forest index/name whose associated mono behavior node is to be enumerated.
Item1.Item3: the tree index/name whose associated mono behavior node is to be enumerated if Item1.Item1 is not HierarchyNodeType.Forest; 0/an empty string otherwise.
Item1.Item4: the node index/name whose associated mono behavior node is to be enumerated if Item1.Item1 is HierarchyNodeType.TreeNonRoot; 0/an empty string otherwise.
Item2: the mono behavior node associated with the (Item1.Item2, Item1.Item3, Item1.Item4) indices/names to be enumerated.
8.2. Enumerate all registered mono behavior nodes under a “forest” mono behavior node
Signature:
static IEnumerable<Tuple<Tuple<HierarchyNodeType, uint, uint, uint>, MonoBehaviorNodeBase>> BtEngine.MonoBehaviorNode.GetEnumerable(uint ForestIndex, FromTreeTo Level)
static IEnumerable<Tuple<Tuple<HierarchyNodeType, string, string, string>, MonoBehaviorNodeBase>> BtEngine.MonoBehaviorNode.GetEnumerable(string ForestName, FromTreeTo Level)
Description:
Exposes an enumerator that supports a simple iteration over all child registered mono behavior nodes of a registered “forest” mono behavior node associated with the specified (forest) index/name in index/name based depth-first traversal order.
Parameters:
ForestIndex The forest index of the parent mono behavior node to start enumeration with.
ForestName The forest name of the parent mono behavior node to start enumeration with.
Level The depth level of mono behavior nodes in the hierarchy.
Return Value:
An IEnumerable interface.
Item1.Item1: the hierarchy node type whose associated mono behavior node is to be enumerated.
Item1.Item2: the forest index/name whose associated mono behavior node is to be enumerated.
Item1.Item3: the tree index/name whose associated mono behavior node is to be enumerated.
Item1.Item4: the node index/name whose associated mono behavior node is to be enumerated if Item1.Item1 is HierarchyNodeType.TreeNonRoot; 0/an empty string otherwise.
Item2: the mono behavior node associated with the (Item1.Item2, Item1.Item3, Item1.Item4) indices/names to be enumerated.
8.3. Enumerate all registered mono behavior nodes under a “tree root” mono behavior node
Signature:
static IEnumerable<Tuple<Tuple<HierarchyNodeType, uint, uint, uint>, MonoBehaviorNodeBase>> BtEngine.MonoBehaviorNode.GetEnumerable(uint ForestIndex, TreeIndex)
static IEnumerable<Tuple<Tuple<HierarchyNodeType, string, string, string>, MonoBehaviorNodeBase>> BtEngine.MonoBehaviorNode.GetEnumerable(string ForestName, TreeName)
Description:
Exposes an enumerator that supports a simple iteration over all child registered mono behavior nodes of a registered “tree root” mono behavior node associated with the specified (forest, tree) indices/names in index/name based depth-first traversal order.
Parameters:
ForestIndex The forest index of the parent mono behavior node to start enumeration with.
TreeIndex The tree index of the parent mono behavior node to start enumeration with.
ForestName The forest name of the parent mono behavior node to start enumeration with.
TreeName The tree name of the parent mono behavior node to start enumeration with.
Return Value:
An IEnumerable interface.
Item1.Item1: the hierarchy node type whose associated mono behavior node is to be enumerated.
Item1.Item2: the forest index/name whose associated mono behavior node is to be enumerated.
Item1.Item3: the tree index/name whose associated mono behavior node is to be enumerated.
Item1.Item4: the node index/name whose associated mono behavior node is to be enumerated.
Item2: the mono behavior node associated with the (Item1.Item2, Item1.Item3, Item1.Item4) indices/names to be enumerated.