Package net.citizensnpcs.api.ai.tree
Class Composite
java.lang.Object
net.citizensnpcs.api.ai.tree.Composite
- All Implemented Interfaces:
Behavior
- Direct Known Subclasses:
ParallelComposite,Selector,Sequence
The base class for composite
Behaviors, which handle the transition between multiple sub-behaviors.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddBehavior(Behavior behavior) voidremoveBehavior(Behavior behavior) voidreset()Resets the behavior and any state it is holding.booleanReturns whether the behavior is ready to run.protected voidstopExecution(Behavior behavior) protected void
-
Field Details
-
parallelExecuting
-
-
Constructor Details
-
Composite
-
Composite
-
-
Method Details
-
addBehavior
-
getBehaviors
-
removeBehavior
-
reset
public void reset()Description copied from interface:BehaviorResets the behavior and any state it is holding. -
shouldExecute
public boolean shouldExecute()Description copied from interface:BehaviorReturns whether the behavior is ready to run. Note this is called once when deciding whether to start execution of a leaf node. The actual execution status is determined by the return value ofBehavior.run()which is repeatedly called by the executing node.- Specified by:
shouldExecutein interfaceBehavior
-
stopExecution
-
tickParallel
protected void tickParallel()
-