(Translated by https://www.hiragana.jp/)
Until Fail Decorator by RedstoneParadox · Pull Request #296 · bitbrain/beehave · GitHub
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

Until Fail Decorator #296

Merged
merged 6 commits into from
Jan 10, 2024

Conversation

RedstoneParadox
Copy link
Contributor

@RedstoneParadox RedstoneParadox commented Jan 9, 2024

Description

Adds a new decorator that runs its child and repeats until the child returns FAILURE, at which point it returns SUCCESS.

The original suggestion by @meticoeus provides additional context:

Motivation: implementing an indeterminate number of repeats based on some condition or set of conditions. This article explains a use-case involving poping data from a stack in the blackboard and going through a subtree based on that data until the stack is empty. I plan to do something similar in a project I'm working on. The number of repeats may grow while the child is repeating long running tasks due to an external actor adding more entities to the stack the sub tree will be using to loop.

Addressed issues

Addresses #240

@RedstoneParadox
Copy link
Contributor Author

RedstoneParadox commented Jan 9, 2024

I'm not sure why the unit tests failed; I ran them personally and they all passed, including the new one. Edit: I forgot to update it after changing the decorator to return success instead of failure.

@RedstoneParadox RedstoneParadox marked this pull request as ready for review January 9, 2024 21:48
@bitbrain bitbrain merged commit c95040f into bitbrain:godot-4.x Jan 10, 2024
4 checks passed
@RcubDev
Copy link

RcubDev commented Feb 5, 2024

Can we close out #240 now that this has been merged?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants