Sets the parent of this Node, and all children Nodes.
Sets the parent of this Node, and all children Nodes.
Getter for the previous event seen.
Getter for the result of the last handled Event.
Returns storage unique to this Node, keyed on the Node's path.
Recursively executes children until one of them returns failure. If we call all the children successfully, return success.
The state when the event occured.
The event to handle.
The child index.
Handles the Event, and invokes onEvent(state, event)
The state when the event occured.
The event to handle.
Initializes the parent of our list of children. Only required to be called if you know your children at construction time. If your children are dynamic, then you are responsible for setting their parent properly when they are created. Note: this repeats code from set parent() because at construction time, this.children will not return anything (this isn't this yet), which is why we have to pass children in as a parameter
list of children to init (can't call getChildren() yet because this is called from the constructor)
Invokes handleChild
for each child.
Return true if this Node should proceed handling the event. false otherwise.
Resets the storage unique to this Node, via the Node's path. If this node is a parent, then also reset all children.
Sends an event to each child until one of the returns
FAILURE
, orRUNNING
, then returns that value. If all children returnSUCCESS
, returnSUCCESS
. If a child returnsRUNNING
, subsequent events start at that child. 1/15/16Joshua Chaitin-Pollak