Package net.citizensnpcs.api.ai
Interface BehaviorController
- All Superinterfaces:
Runnable
- All Known Implementing Classes:
SimpleBehaviorController
Represents a collection of behaviors that are prioritised and executed.
The highest priority Behavior that returns true in Behavior.shouldExecute() is executed.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddBehavior(Behavior behavior) Registers aBehavior.voidclear()Clears the goal controller of allBehaviors.booleanisPaused()voidremoveBehavior(Behavior behavior) Removes the givenBehaviorfrom rotation.voidsetPaused(boolean paused) Sets whether the controller is paused.
-
Method Details
-
addBehavior
Registers aBehavior.- Parameters:
behavior- The behavior
-
clear
void clear()Clears the goal controller of allBehaviors. Will stop the execution of any current behavior. -
isPaused
boolean isPaused()- Returns:
- Whether the controller is currently paused
- See Also:
-
removeBehavior
Removes the givenBehaviorfrom rotation.- Parameters:
behavior- The behavior to remove
-
setPaused
void setPaused(boolean paused) Sets whether the controller is paused. While paused, no newBehaviors will be selected and any executing goals will be suspended.- Parameters:
paused- Whether to pause execution
-