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
Group Tree Operations – Forest Level | BtEngineSDK

Group Tree Operations – Forest Level

Table of contents

1. Start to execute all the trees in a forest
2. Start to execute all the trees in a forest with a target loop count and basic play mode
3. Pause all the trees in a forest
4. Resume to execute all the trees that were paused in a forest
5. Stop all the trees in a forest
6. Reset all the trees in a forest
7. Load a forest and all the trees in it from XML files
8. Destroy a forest and all the trees in it

1. Start to execute all the trees in a forest
Signature:
static bool BtEngine.Play(string ForestName)
static bool BtEngine.Play(uint ForestIndex)
Description:
Asynchronously starts to execute all tree instances in a forest with the specified (forest) name/index, previously specified target loop count (0 by default) and basic play mode (StopByExecuteLoopCount by default).
Parameters:
ForestName The name of the forest instance to locate and invoke.
ForestIndex The index of the forest instance to locate and invoke.
Return Value:
True if the operation was enqueued; false otherwise.
Complexity:
O(log f + t), where f is the count of forest instance and t is the count of whose child tree instance.
2. Start to execute all the trees in a forest with a target loop count and basic play mode
Signature:
static bool BtEngine.Play(string ForestName, uint TgtLoopCount, BasicPlayMode Mode)
static bool BtEngine.Play(uint ForestIndex, uint TgtLoopCount, BasicPlayMode Mode)
Description:
Asynchronously starts to execute all tree instances in a forest with the specified (forest) name/index, target loop count and basic play mode.
Parameters:
ForestName The name of the forest instance to locate and invoke.
ForestIndex The index of the forest instance to locate and invoke.
TgtLoopCount The target loop count for this execution as specified by the basic play mode. Enter 0 for an infinite loop.
Mode The basic play mode for this execution which specifies the way to count loop number and stop execution.
Return Value:
True if the operation was enqueued; false otherwise.
Complexity:
O(log f + t), where f is the count of forest instance and t is the count of whose child tree instance.
3. Pause all the trees in a forest
Signature:
static bool BtEngine.Pause(string ForestName, bool Sync)
static bool BtEngine.Pause(uint ForestIndex, bool Sync)
Description:
Asynchronously pauses all tree instances in a forest with the specified (forest) name/index.
Parameters:
ForestName The name of the forest instance to locate and invoke.
ForestIndex The index of the forest instance to locate and invoke.
Sync True to keep each tree instance’s state unchanged until whose OnPause operation returns; false otherwise.
Return Value:
True if the operation was enqueued; false otherwise.
Complexity:
O(log f + t), where f is the count of forest instance and t is the count of whose child tree instance.
4. Resume to execute all the trees that were paused in a forest
Signature:
static bool BtEngine.Resume(string ForestName)
static bool BtEngine.Resume(uint ForestIndex)
Description:
Asynchronously resumes to execute all tree instances that were paused in a forest with the specified (forest) name/index and tree specific remaining loop count.
Parameters:
ForestName The name of the forest instance to locate and invoke.
ForestIndex The index of the forest instance to locate and invoke.
Return Value:
True if the operation was enqueued; false otherwise.
Complexity:
O(log f + t), where f is the count of forest instance and t is the count of whose child tree instance.
5. Stop all the trees in a forest
Signature:
static bool BtEngine.Stop(string ForestName, bool Sync)
static bool BtEngine.Stop(uint ForestIndex, bool Sync)
Description:
Asynchronously stops all tree instances in a forest with the specified (forest) name/index.
Parameters:
ForestName The name of the forest instance to locate and invoke.
ForestIndex The index of the forest instance to locate and invoke.
Sync True to keep each tree instance’s state unchanged until whose OnStop operation returns; false otherwise.
Return Value:
True if the operation was enqueued; false otherwise.
Complexity:
O(log f + t), where f is the count of forest instance and t is the count of whose child tree instance.
6. Reset all the trees in a forest
Signature:
static bool BtEngine.Reset(string ForestName, bool Sync)
static bool BtEngine.Reset(uint ForestIndex, bool Sync)
Description:
Asynchronously resets all tree instances in a forest with the specified (forest) name/index.
Parameters:
ForestName The name of the forest instance to locate and invoke.
ForestIndex The index of the forest instance to locate and invoke.
Sync True to keep each tree instance’s state unchanged until whose OnReset operation returns; false otherwise.
Return Value:
True if the operation was enqueued; false otherwise.
Complexity:
O(log f + t), where f is the count of forest instance and t is the count of whose child tree instance.
7. Load a forest and all the trees in it from XML files
Signature:
static bool BtEngine.Load(string ForestName, bool Sync)
static bool BtEngine.Load(uint ForestIndex, bool Sync)
Description:
Asynchronously instantiates all the trees whose instances don’t exist in a forest with the specified (forest) name/index, as well as the forest itself if its instance doesn’t exist, from the forest xml file and tree xml files.
Parameters:
ForestName The name of the forest instance to locate and invoke.
ForestIndex The index of the forest instance to locate and invoke.
Sync True to keep the forest and each tree instance’s state unchanged until whose OnConstruct operation returns; false otherwise.
Return Value:
True if the operation was enqueued; false otherwise.
Complexity:
O(log f + t * n), 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.
8. Destroy a forest and all the trees in it
Signature:
static bool BtEngine.Destroy(string ForestName, bool Sync)
static bool BtEngine.Destroy(uint ForestIndex, bool Sync)
Description:
Asynchronously deletes a forest instance and all tree instances in it with the specified (forest) name/index. If parallel operation, i.e., tree specific operation queue, is enabled, this operation cancels all the parallel tree specific queued operations of Play, Pause, Resume, Stop and Reset that were issued before it and then gets invoked right away.
Parameters:
ForestName The name of the forest instance to locate and invoke.
ForestIndex The index of the forest instance to locate and invoke.
Sync True to keep the forest and each tree instance’s state unchanged until whose OnDestruct operation returns; false otherwise.
Return Value:
True if the operation was enqueued; false otherwise.
Complexity:
O(log f + t * n), 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.