We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi, seems that Sutra is unable to process nested rule functions, here an example:
import { Sutra } from '@yantra-core/sutra'; // creates a new sutra instance const s = new Sutra(); s.addCondition('gt 0', (e) => e > 0); s.addCondition('gt 10', (e) => e > 10); s.addCondition('gt 20', (e) => e > 20); s .if('gt 0') .then(rules => rules .if('gt 20') .then('ok greater then 20') .else( rules => rules .if('gt 10') .then('OK greater than 10') .else('KO lower than 10') ) ).else('KO lower than 0'); s.onAny((ev, data, node) => { console.log('onAny', ev); }); s.tick(1); s.tick(14); s.tick(-5);
OUTPUT:
onAny [Function (anonymous)] onAny [Function (anonymous)] onAny KO lower than 0
It's my fault constructing behavior tree or it's a bug?
Thank you so much
The text was updated successfully, but these errors were encountered:
I'm not sure. There are lots of passing tests for nested. If you can check in a failing test we could look at it.
I would recommend looking at the tests for usage.
Sorry, something went wrong.
No branches or pull requests
Hi,
seems that Sutra is unable to process nested rule functions, here an example:
OUTPUT:
It's my fault constructing behavior tree or it's a bug?
Thank you so much
The text was updated successfully, but these errors were encountered: