-
-
Notifications
You must be signed in to change notification settings - Fork 122
feat(decorators): add three new decorators #8
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
Conversation
RepeatForever, RepeatUntilSuccess, and RepeatUntilFailure are new decorators used to continue a task indefinitely. RepeatForever executes its child and returns TaskStatus.Continue, regardless of its child's return status. RepeatUntilSuccess returns TaskStatus.Success if its child returns success, else it returns TaskStatus.Continue. RepeatUntilFailure returns TaskStatus.Failure if its child returns failure, else it returns TaskStatus.Continue.
|
@JesseTG Just realizing there aren't any docs. My bad for not listing that anywhere (put a task in this week to setup some contribution guidelines that specify a checklist for PRs). If you have some spare time to throw in some |
|
Oops. My bad. Yeah, I'll whip them up today or tomorrow. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall this really looks great. After having some time to mull over this, had some thoughts on improving the code structure of decorators as a whole. The tests look solid, but the biggest thing I'm realizing is checks for a missing child should be moved into the parent. Also some minor things like missing docs and a little code maintenance. Getting a stylecop and editorconfig is on my list, which should help to reduce minor comments.
Commits could be broken up into three to clarify each new feature on the changelog. But no worries on that. Glad that the new features are well documented.
Sorry it took me so long to get to this. Tree visualizer took on a life of its own this week. Should be the largest feature added to Fluid BT for quite a while.
PS If you have time to tackle these items today that'd be awesome. If not I should be able to get to these Monday or Tuesday and merge everything in to develop.
Assets/FluidBehaviorTree/Runtime/Decorators/RepeatUntilFailure.cs
Outdated
Show resolved
Hide resolved
Assets/FluidBehaviorTree/Runtime/Decorators/RepeatUntilFailure.cs
Outdated
Show resolved
Hide resolved
Assets/FluidBehaviorTree/Tests/Editor/Decorators/RepeatUntilFailureTest.cs
Show resolved
Hide resolved
Assets/FluidBehaviorTree/Runtime/Decorators/RepeatUntilSuccess.cs
Outdated
Show resolved
Hide resolved
Assets/FluidBehaviorTree/Runtime/Decorators/RepeatUntilSuccess.cs
Outdated
Show resolved
Hide resolved
Assets/FluidBehaviorTree/Tests/Editor/Decorators/RepeatForeverTest.cs
Outdated
Show resolved
Hide resolved
Assets/FluidBehaviorTree/Runtime/BehaviorTree/Builder/BehaviorTreeBuilder.cs
Show resolved
Hide resolved
Assets/FluidBehaviorTree/Runtime/BehaviorTree/Builder/BehaviorTreeBuilder.cs
Show resolved
Hide resolved
|
I've pushed a commit that will remove the need for any missing child decorator checks. Pull the latest and it should allow you to remove the corresponding logic as noted in the comments. |
Remove unneeded local variables, and let the three new decorators return `TaskStatus.Failure` if they have no child
Now that DecoratorBase returns failure if it has no child, Does_not_crash_if_no_child can be moved to the base decorator tests
Adds documentation for RepeatForever, RepeatUntilSuccess, and RepeatUntilFailure to README.md
Add icons for representing RepeatForever, RepeatUntilFailure, and RepeatUntilSuccess in the visualizer
ashblue
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚢
|
@all-contributors please add @JesseTG for repeat decorator actions |
|
I couldn't determine any contributions to add, did you specify any contributions? |
|
@all-contributors please add @JesseTG for code |
|
I've put up a pull request to add @JesseTG! 🎉 |
|
🎉 This PR is included in version 2.2.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
RepeatForever, RepeatUntilSuccess, and RepeatUntilFailure are new decorators used to continue a task
indefinitely. RepeatForever executes its child and returns TaskStatus.Continue, regardless of its
child's return status. RepeatUntilSuccess returns TaskStatus.Success if its child returns success,
else it returns TaskStatus.Continue. RepeatUntilFailure returns TaskStatus.Failure if its child
returns failure, else it returns TaskStatus.Continue.