Contents
- Description
- Field Summary
- Constructor Summary
- Method Summary
- Constructor Details
- Method Details
- canExecute(Ref, ExecutionSupport, InfoProvider, double, Store)
- execute(Ref, ExecutionSupport, InfoProvider, double, Store)
- isBusy()
- registerWithSupport(ExecutionSupport)
- motionControllerChanged(Ref, NPCEntity, MotionController, ComponentAccessor)
- loaded(ExecutionSupport)
- spawned(ExecutionSupport)
- unloaded(ExecutionSupport)
- removed(ExecutionSupport)
- teleported(ExecutionSupport, World, World)
- clearOnce()
- setContext(IAnnotatedComponent, int)
Class ActionForEach
java.lang.Object
com.hypixel.hytale.server.npc.corecomponents.AnnotatedComponentBase
com.hypixel.hytale.server.npc.corecomponents.ActionBase
com.hypixel.hytale.server.npc.corecomponents.utility.ActionSequence
com.hypixel.hytale.server.npc.corecomponents.utility.ActionForEach
- All Implemented Interfaces:
Action, RoleStateChange, IAnnotatedComponent, IAnnotatedComponentCollection, IComponentExecutionControl
Runs its nested action list once for every target/position the sensor produced (see
IPositionSet).-
Field Summary
Fields inherited from interface Action
EMPTY_ARRAY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanExecute(Ref<EntityStore> ref, ExecutionSupport executionSupport, InfoProvider sensorInfo, double dt, Store<EntityStore> store) Test if an action can be executedvoidbooleanexecute(Ref<EntityStore> ref, ExecutionSupport executionSupport, InfoProvider sensorInfo, double dt, Store<EntityStore> store) Execute actionbooleanisBusy()Whether this action has work in flight that spans ticks (e.g. a deferred/delayed continuation bound to this instance).voidloaded(ExecutionSupport executionSupport) voidmotionControllerChanged(Ref<EntityStore> ref, NPCEntity npcComponent, MotionController motionController, ComponentAccessor<EntityStore> componentAccessor) voidregisterWithSupport(ExecutionSupport executionSupport) voidremoved(ExecutionSupport executionSupport) voidsetContext(IAnnotatedComponent parent, int index) voidspawned(ExecutionSupport executionSupport) voidteleported(ExecutionSupport executionSupport, World from, World to) voidunloaded(ExecutionSupport executionSupport) Methods inherited from class ActionSequence
componentCount, getComponent, setOnceMethods inherited from class ActionBase
activate, deactivate, isActivated, isTriggered, processDelayMethods inherited from class AnnotatedComponentBase
getIndex, getInfo, getParentMethods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface IAnnotatedComponent
getBreadCrumbs, getBreadCrumbs, getIndex, getInfo, getLabel, getParent
-
Constructor Details
-
ActionForEach
-
-
Method Details
-
canExecute
public boolean canExecute(@Nonnull Ref<EntityStore> ref, @Nonnull ExecutionSupport executionSupport, @Nullable InfoProvider sensorInfo, double dt, @Nonnull Store<EntityStore> store) Description copied from interface:ActionTest if an action can be executed- Specified by:
canExecutein interfaceAction- Overrides:
canExecutein classActionSequence- Parameters:
ref- The entity refexecutionSupport- The execution supportsensorInfo- SensorInfo with PositionProvider, PathProvider, etc if requireddt- The interval in seconds for this calculationstore- The component store- Returns:
- true if action can be executed else false to skip execution
-
execute
public boolean execute(@Nonnull Ref<EntityStore> ref, @Nonnull ExecutionSupport executionSupport, @Nullable InfoProvider sensorInfo, double dt, @Nonnull Store<EntityStore> store) Description copied from interface:ActionExecute action- Specified by:
executein interfaceAction- Overrides:
executein classActionSequence- Parameters:
ref- The entity refexecutionSupport- The execution supportsensorInfo- SensorInfo with PositionProvider, PathProvider, etc if requireddt- The interval in seconds for this calculationstore- The component store- Returns:
- true when executed action has finished else false when execution is not completed yet
-
isBusy
public boolean isBusy()Description copied from interface:ActionWhether this action has work in flight that spans ticks (e.g. a deferred/delayed continuation bound to this instance). Used byForEach's per-target instance pool to avoid recycling a slot whose action is still mid-execution. Defaults tofalse.- Specified by:
isBusyin interfaceAction- Overrides:
isBusyin classActionSequence
-
registerWithSupport
- Specified by:
registerWithSupportin interfaceRoleStateChange- Overrides:
registerWithSupportin classActionSequence
-
motionControllerChanged
public void motionControllerChanged(@Nullable Ref<EntityStore> ref, @Nonnull NPCEntity npcComponent, MotionController motionController, @Nullable ComponentAccessor<EntityStore> componentAccessor) - Specified by:
motionControllerChangedin interfaceRoleStateChange- Overrides:
motionControllerChangedin classActionSequence
-
loaded
- Specified by:
loadedin interfaceRoleStateChange- Overrides:
loadedin classActionSequence
-
spawned
- Specified by:
spawnedin interfaceRoleStateChange- Overrides:
spawnedin classActionSequence
-
unloaded
- Specified by:
unloadedin interfaceRoleStateChange- Overrides:
unloadedin classActionSequence
-
removed
- Specified by:
removedin interfaceRoleStateChange- Overrides:
removedin classActionSequence
-
teleported
- Specified by:
teleportedin interfaceRoleStateChange- Overrides:
teleportedin classActionSequence
-
clearOnce
public void clearOnce()- Specified by:
clearOncein interfaceIComponentExecutionControl- Overrides:
clearOncein classActionSequence
-
setContext
- Specified by:
setContextin interfaceIAnnotatedComponent- Overrides:
setContextin classActionSequence
-