public class SequentialBehavior extends Object
Behavior.waitingFor()
method of its active child. The behavior is
finished if all children are finished.Constructor and Description |
---|
SequentialBehavior(BehaviorController controller)
Instantiates the behavior with the specified controller.
|
Modifier and Type | Method and Description |
---|---|
void |
addSubBehavior(Behavior subBehavior)
Add a sub-behavior to this composite behavior.
|
boolean |
isFinished()
Indicates whether the behavior is finished or requires re-scheduling.
|
void |
removeSubBehavior(Behavior subBehavior)
Remove a sub-behavior from this composite behavior.
|
Result |
result()
Returns the result of the behavior.
|
void |
run()
The implementation of the actual behavior.
|
EventPattern |
waitingFor()
Defines the event pattern for re-scheduling.
|
public SequentialBehavior(BehaviorController controller)
controller
- the controller of this behaviorpublic void run()
Behavior
public EventPattern waitingFor()
Defines the event pattern for re-scheduling. The behavior controller will re-schedule the behavior if an event occurs that is covered by the pattern.
The return value is the event pattern of the currently active child.
null
if the behavior is finishedpublic void addSubBehavior(Behavior subBehavior)
subBehavior
- the sub-behavior to be added.public void removeSubBehavior(Behavior subBehavior)
subBehavior
- the sub-behavior to be removed.public boolean isFinished()
Behavior
isFinished
in interface Behavior
true
if the behavior is finished,
false
otherwiseCopyright © Aimpulse Intelligent Systems GmbH
All rights reserved.