public abstract class Precondition extends BehaviorGoalAdapter
Modifier | Constructor and Description |
---|---|
protected |
Precondition(Condition condition) |
Modifier and Type | Method and Description |
---|---|
static Precondition |
runPrecondition(Condition condition)
Creates a
Precondition that returns either BehaviorStatus.SUCCESS or
BehaviorStatus.FAILURE depending on the underlying Condition 's return status. |
static Precondition |
wrappingPrecondition(Behavior wrapping,
Condition condition)
|
create, run, shouldExecute
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
reset, run, shouldExecute
protected final Condition condition
protected Precondition(Condition condition)
public static Precondition runPrecondition(Condition condition)
Precondition
that returns either BehaviorStatus.SUCCESS
or
BehaviorStatus.FAILURE
depending on the underlying Condition
's return status.condition
- The condition to check while executingpublic static Precondition wrappingPrecondition(Behavior wrapping, Condition condition)
Precondition
that wraps the shouldExecute
method in Behavior
. When
shouldExecute
is called, the given Condition
will be checked before the wrapped behavior's
method is called.wrapping
- The behavior to wrap calls tocondition
- The execution conditionCopyright © 2021. All rights reserved.