Package net.citizensnpcs.api.ai.tree
Class Precondition
java.lang.Object
net.citizensnpcs.api.ai.tree.BehaviorGoalAdapter
net.citizensnpcs.api.ai.tree.Precondition
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic PreconditionrunPrecondition(Condition condition) Creates aPreconditionthat returns eitherBehaviorStatus.SUCCESSorBehaviorStatus.FAILUREdepending on the underlyingCondition's return status.static PreconditionwrappingPrecondition(Behavior wrapping, Condition condition) Methods inherited from class net.citizensnpcs.api.ai.tree.BehaviorGoalAdaptercreate, run, shouldExecuteMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.citizensnpcs.api.ai.tree.Behaviorreset, run, shouldExecute
- 
Field Details- 
condition
 
- 
- 
Constructor Details- 
Precondition
 
- 
- 
Method Details- 
runPreconditionCreates aPreconditionthat returns eitherBehaviorStatus.SUCCESSorBehaviorStatus.FAILUREdepending on the underlyingCondition's return status.- Parameters:
- condition- The condition to check while executing
- Returns:
- The precondition behavior
 
- 
wrappingPreconditionCreates aPreconditionthat wraps theshouldExecutemethod inBehavior. WhenshouldExecuteis called, the givenConditionwill be checked before the wrapped behavior's method is called.- Parameters:
- wrapping- The behavior to wrap calls to
- condition- The execution condition
- Returns:
- The precondition behavior
 
 
-