You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How do you make a while loop that does not check the loop condition continuously? It seems that when you create a loop with While, the condition for the While is checked between each behavior. Sometimes what you want is for the behaviours to run and succeed in sequence order before the condition for the upper While is ran to determine if the While block should continue executing another loop, basically just like it is with any programming language and its while loop.
let loop1 = While(Box::new(Action(Self::LoopCondition)),vec![Action(Self::Task1),Action(Self::Task2)]);
This is what happens:
check loop condition (running)
run Task1 (running)
check loop condition (running)
run Task1 (success)
check loop condition (success)
while is terminated
And this is what I want:
check loop condition (running)
run Task1 (running)
run Task1 (success)
run Task2 (success)
check loop condition (success)
while is terminated
I also tried to throw Sequence as a wrapper, but the While still keeps checking the condition between each behavior.
let loop2 = While(Box::new(Action(Self::LoopCondition)),vec![Sequence(vec![Action(Self::Task1),Action(Self::Task2)])],);
The text was updated successfully, but these errors were encountered:
How do you make a while loop that does not check the loop condition continuously? It seems that when you create a loop with
While
, the condition for theWhile
is checked between each behavior. Sometimes what you want is for the behaviours to run and succeed in sequence order before the condition for the upperWhile
is ran to determine if theWhile
block should continue executing another loop, basically just like it is with any programming language and itswhile
loop.This is what happens:
And this is what I want:
I also tried to throw
Sequence
as a wrapper, but theWhile
still keeps checking the condition between each behavior.The text was updated successfully, but these errors were encountered: