Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node OnVisited event #19

Closed
Timmoth opened this issue Dec 5, 2019 · 1 comment
Closed

Node OnVisited event #19

Timmoth opened this issue Dec 5, 2019 · 1 comment
Labels

Comments

@Timmoth
Copy link
Collaborator

Timmoth commented Dec 5, 2019

Currently you have to keep a reference to a node and subscribe to its OnVisited event in order to call node.Exit() to move to the next node

For Example:

var T1 = nodeGraph.Create("T1");
T1.OnVisited += (s) =>
{
s.Exit();
};

This must be done for each node or else it will stay on that node forever.

I propose a default 'Instant transition' behaviour which moves to the next node as soo as the node is visited.

Also I propose that a subscriber can be set through the NodeGraph

nodeGraph.Visited("T1", OnT1Visited);
nodeGraph.Visited("T2", (sender)=>{ sender.Exit(); });

@Timmoth Timmoth added the todo label Dec 5, 2019
Timmoth added a commit that referenced this issue Dec 5, 2019
Timmoth added a commit that referenced this issue Dec 5, 2019
Fixed issue Node OnVisited event #19
@Timmoth Timmoth closed this as completed Dec 5, 2019
@Timmoth
Copy link
Collaborator Author

Timmoth commented Dec 5, 2019

#20

@Timmoth Timmoth reopened this Dec 5, 2019
@Timmoth Timmoth closed this as completed Dec 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant