-
-
Notifications
You must be signed in to change notification settings - Fork 158
Closed
Labels
🍯 featureA new addition to this addon.A new addition to this addon.
Milestone
Description
Overview
We could have enter() and exit() methods for when its necessary to do some setup or cleanup before or after the first and last ticks.
The enter() and exit() methods would be called before the first tick() and after the last, respectively.
For more information, checkout #117
Possible implementation
We create an execute() method inside BeehaveNode to be called by parent nodes only. This method will call enter(), tick() and exit() when needed as well as return the result of tick().
func execute(actor: Node, blackboard: Blackboard) -> int:
if not _has_entered:
enter(actor, blackboard)
_has_entered = true
var result = tick(actor, blackboard)
if result != RUNNING:
exit(actor, blackboard)
_has_entered = false
return resultThis way, we only need to change composite nodes to call execute() instead of tick(). Composites and leaf nodes should never override the execute() method, only tick().
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
🍯 featureA new addition to this addon.A new addition to this addon.