Tree Properties

Table of contents

1. Determine whether a tree exists
2. Get the node type of a tree
3. Get the index/name of a tree
4. Get the status of a tree
5. Get the basic play mode of a tree
6. Get the target loop count of a tree
7. Get the accumulated loop count of a tree
8. Get the node count of a tree
9. Get the tree property wrapper of a tree

1. Determine whether a tree exists
Signature:
static bool BtEngine.Exist(string ForestName, string TreeName)
static bool BtEngine.Exist(uint ForestIndex, uint TreeIndex)
Description:
Determines whether a tree instance with the specified (forest, tree) names/indices exists.
Parameters:
ForestName The name of the forest instance whose presence is to be determined.
TreeName The name of the tree instance whose presence is to be determined.
ForestIndex The index of the forest instance whose presence is to be determined.
TreeIndex The index of the tree instance whose presence is to be determined.
Return Value:
True if the tree instance with the specified (forest, tree) names/indices was present; false otherwise.
Complexity:
O(log f + log t), where f is the count of forest instance and t is the count of whose child tree instance.
2. Get the node type of a tree
Signature:
static Tuple<bool, NodeType> BtEngine.GetNodeType(string ForestName, string TreeName)
static Tuple<bool, NodeType> BtEngine.GetNodeType(uint ForestIndex, uint TreeIndex)
Description:
Gets the node type of a tree instance with the specified (forest, tree) names/indices.
Parameters:
ForestName The name of the forest instance to locate and invoke.
TreeName The name of the tree instance to locate and invoke.
ForestIndex The index of the forest instance to locate and invoke.
TreeIndex The index of the tree instance to locate and invoke.
Return Value:
A tuple. Item1: true if the tree instance with the specified (forest, tree) names/indices was present; false otherwise. Item2: NodeType.TreeRoot.
Complexity:
O(log f + log t), where f is the count of forest instance and t is the count of whose child tree instance.
3. Get the index/name of a tree
Signature:
static Tuple<bool, uint> BtEngine.GetIndex(string ForestName, string TreeName)
static Tuple<bool, string> BtEngine.GetName(uint ForestIndex, uint TreeIndex)
Description:
Gets the index/name of a tree instance with the specified (forest, tree) names/indices.
Parameters:
ForestName The name of the forest instance to locate and invoke.
TreeName The name of the tree instance to locate and invoke.
ForestIndex The index of the forest instance to locate and invoke.
TreeIndex The index of the tree instance to locate and invoke.
Return Value:
A tuple. Item1: true if the tree instance with the specified (forest, tree) names/indices was present; false otherwise. Item2: the index/name of the tree instance if Item1 is true; 0/an empty string otherwise.
Complexity:
O(log f + log t), where f is the count of forest instance and t is the count of whose child tree instance.
4. Get the status of a tree
Signature:
static Tuple<bool, TreeStatus> BtEngine.GetTreeStatus(string ForestName, string TreeName)
static Tuple<bool, TreeStatus> BtEngine.GetTreeStatus(uint ForestIndex, uint TreeIndex)
Description:
Gets the status of a tree instance with the specified (forest, tree) names/indices.
Parameters:
ForestName The name of the forest instance to locate and invoke.
TreeName The name of the tree instance to locate and invoke.
ForestIndex The index of the forest instance to locate and invoke.
TreeIndex The index of the tree instance to locate and invoke.
Return Value:
A tuple. Item1: true if the tree instance with the specified (forest, tree) names/indices was present; false otherwise. Item2: the status of the tree instance if Item1 is true; TreeStatus.Destructed otherwise.
Complexity:
O(log f + log t), where f is the count of forest instance and t is the count of whose child tree instance.
5. Get the basic play mode of a tree
Signature:
static Tuple<bool, BasicPlayMode> BtEngine.GetBasicPlayMode(string ForestName, string TreeName)
static Tuple<bool, BasicPlayMode> BtEngine.GetBasicPlayMode(uint ForestIndex, uint TreeIndex)
Description:
Gets the basic play mode of a tree instance with the specified (forest, tree) names/indices.
Parameters:
ForestName The name of the forest instance to locate and invoke.
TreeName The name of the tree instance to locate and invoke.
ForestIndex The index of the forest instance to locate and invoke.
TreeIndex The index of the tree instance to locate and invoke.
Return Value:
A tuple. Item1: true if the tree instance with the specified (forest, tree) names/indices was present; false otherwise. Item2: the basic play mode of the tree instance if Item1 is true; BasicPlayMode.StopByExecuteLoopCount otherwise.
Complexity:
O(log f + log t), where f is the count of forest instance and t is the count of whose child tree instance.
6. Get the target loop count of a tree
Signature:
static Tuple<bool, uint> BtEngine.GetTgtLoopCount(string ForestName, string TreeName)
static Tuple<bool, uint> BtEngine.GetTgtLoopCount(uint ForestIndex, uint TreeIndex)
Description:
Gets the target loop count of a tree instance with the specified (forest, tree) names/indices.
Parameters:
ForestName The name of the forest instance to locate and invoke.
TreeName The name of the tree instance to locate and invoke.
ForestIndex The index of the forest instance to locate and invoke.
TreeIndex The index of the tree instance to locate and invoke.
Return Value:
A tuple. Item1: true if the tree instance with the specified (forest, tree) names/indices was present; false otherwise. Item2: the target loop count of the tree instance if Item1 is true; 0 otherwise.
Complexity:
O(log f + log t), where f is the count of forest instance and t is the count of whose child tree instance.
7. Get the accumulated loop count of a tree
Signature:
static Tuple<bool, uint> BtEngine.GetAccuLoopCount(string ForestName, string TreeName)
static Tuple<bool, uint> BtEngine.GetAccuLoopCount(uint ForestIndex, uint TreeIndex)
Description:
Gets the accumulated loop count of a tree instance with the specified (forest, tree) names/indices.
Parameters:
ForestName The name of the forest instance to locate and invoke.
TreeName The name of the tree instance to locate and invoke.
ForestIndex The index of the forest instance to locate and invoke.
TreeIndex The index of the tree instance to locate and invoke.
Return Value:
A tuple. Item1: true if the tree instance with the specified (forest, tree) names/indices was present; false otherwise. Item2: the accumulated loop count of the tree instance if Item1 is true; 0 otherwise.
Complexity:
O(log f + log t), where f is the count of forest instance and t is the count of whose child tree instance.
8. Get the node count of a tree
Signature:
static Tuple<bool, uint> BtEngine.GetNodeCount(string ForestName, string TreeName)
static Tuple<bool, uint> BtEngine.GetNodeCount(uint ForestIndex, uint TreeIndex)
Description:
Gets the number of node instances in a tree with the specified (forest, tree) names/indices.
Parameters:
ForestName The name of the forest instance to locate and invoke.
TreeName The name of the tree instance to locate and invoke.
ForestIndex The index of the forest instance to locate and invoke.
TreeIndex The index of the tree instance to locate and invoke.
Return Value:
A tuple. Item1: true if the tree instance with the specified (forest, tree) names/indices was present; false otherwise. Item2: the number of node instances in the tree if Item1 is true; 0 otherwise.
Complexity:
O(log f + log t), where f is the count of forest instance and t is the count of whose child tree instance.
9. Get the tree property wrapper of a tree
Signature:
static Tuple<bool, TreePropWrap> BtEngine.GetTreePropWrap(string ForestName, string TreeName, FromTreeTo Level)
static Tuple<bool, TreePropWrap> BtEngine.GetTreePropWrap(uint ForestIndex, uint TreeIndex, FromTreeTo Level)
Description:
Gets a tree property wrapper that contains all the information of a tree instance with the specified (forest, tree) names/indices and depth level.
Parameters:
ForestName The name of the forest instance to locate and invoke.
TreeName The name of the tree instance to locate and invoke.
ForestIndex The index of the forest instance to locate and invoke.
TreeIndex The index of the tree instance to locate and invoke.
Level The depth level of the information in the property wrapper.
Return Value:
A tuple. Item1: true if the tree instance with the specified (forest, tree) names/indices was present; false otherwise. Item2: a tree property wrapper that contains all the information of the tree instance if Item1 is true; null otherwise.
Complexity:
O(log f + log t) if level is FromTreeTo.Tree, O(log f + log t + n) if level is FromTreeTo.Node, where f is the count of forest instance, t is the count of whose child tree instance and n is the count of whose child node instance.