Contents
Interface Action
- All Superinterfaces:
IAnnotatedComponent, IComponentExecutionControl, RoleStateChange
- All Known Implementing Classes:
ActionAddToTargetMemory, ActionAdjustPortalTimer, ActionAdjustPosition, ActionAppearance, ActionApplyEntityEffect, ActionAttack, ActionBase, ActionBeacon, ActionBlockHitInteraction, ActionChangeTargetRole, ActionClearEncounterBossBar, ActionClearEncounterWeather, ActionCombatAbility, ActionCompleteTask, ActionCrouch, ActionDelayDespawn, ActionDespawn, ActionDie, ActionDisplayName, ActionDropItem, ActionEntityHitInteraction, ActionFlockBeacon, ActionFlockJoin, ActionFlockLeave, ActionFlockSetTarget, ActionFlockState, ActionForEach, ActionGrantReward, ActionIgnoreForAvoidance, ActionInventory, ActionLockOnInteractionTarget, ActionLog, ActionMakePath, ActionModelAttachment, ActionMount, ActionNothing, ActionNotify, ActionOpenBarterShop, ActionOpenShop, ActionOverrideAltitude, ActionOverrideAttitude, ActionParentState, ActionPickUpItem, ActionPlaceBlock, ActionPlayAnimation, ActionPlaySound, ActionProjectToGround, ActionRandom, ActionRecomputePath, ActionReleaseTarget, ActionRemove, ActionResetBlockSensors, ActionResetInstructions, ActionResetPath, ActionResetSearchRays, ActionRole, ActionSequence, ActionSetAlarm, ActionSetBlockToPlace, ActionSetEncounterAudioState, ActionSetEncounterBossBar, ActionSetEncounterWeather, ActionSetFlag, ActionSetHealthRegen, ActionSetInteractable, ActionSetInvulnerable, ActionSetLeashPosition, ActionSetMarkedTarget, ActionSetStat, ActionSetTargetNPCInvulnerable, ActionSignalTaggedVolumes, ActionSignalWorldEvent, ActionSpawn, ActionSpawnInteraction, ActionSpawnParticles, ActionStartEncounterMusic, ActionStartObjective, ActionState, ActionStopEncounterMusic, ActionStorePosition, ActionTest, ActionTimeout, ActionTimer, ActionToggleStateEvaluator, ActionTransformBase, ActionTriggerSpawnBeacon, ActionTriggerSpawners, ActionWithDelay, DeferrableAction, WeightedAction
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate(ExecutionSupport executionSupport, InfoProvider infoProvider) Called when the action is activated.booleancanExecute(Ref<EntityStore> ref, ExecutionSupport executionSupport, InfoProvider sensorInfo, double dt, Store<EntityStore> store) Test if an action can be executedvoiddeactivate(ExecutionSupport executionSupport, InfoProvider infoProvider) Called when the action is deactivated.booleanexecute(Ref<EntityStore> ref, ExecutionSupport executionSupport, InfoProvider sensorInfo, double dt, Store<EntityStore> store) Execute actionbooleanChecks if this action has been activated.default booleanisBusy()Whether this action has work in flight that spans ticks (e.g. a deferred/delayed continuation bound to this instance).Methods inherited from interface IAnnotatedComponent
getBreadCrumbs, getBreadCrumbs, getIndex, getInfo, getLabel, getParent, setContextMethods inherited from interface IComponentExecutionControl
clearOnce, isTriggered, processDelay, setOnceMethods inherited from interface RoleStateChange
loaded, motionControllerChanged, registerWithSupport, removed, spawned, teleported, unloaded
-
Field Details
-
EMPTY_ARRAY
-
-
Method Details
-
canExecute
boolean canExecute(@Nonnull Ref<EntityStore> ref, @Nonnull ExecutionSupport executionSupport, @Nullable InfoProvider sensorInfo, double dt, @Nonnull Store<EntityStore> store) Test if an action can be executed- 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
boolean execute(@Nonnull Ref<EntityStore> ref, @Nonnull ExecutionSupport executionSupport, @Nullable InfoProvider sensorInfo, double dt, @Nonnull Store<EntityStore> store) Execute action- 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
-
activate
Called when the action is activated. In normal lists, this will be called for all actions in the list that can be executed. In blocking sequences, this will be called prior to beginning the first execution of the action in the current cycle.- Parameters:
executionSupport- The execution supportinfoProvider- the InfoProvider from the parent sensor.
-
deactivate
Called when the action is deactivated. In normal lists, this will be called if the action cannot be executed. In blocking sequences, this will be called when the execution of the action completes before moving to the next action.- Parameters:
executionSupport- The execution supportinfoProvider- the InfoProvider from the parent sensor.
-
isActivated
boolean isActivated()Checks if this action has been activated.- Returns:
trueif activated,falseif not.
-
isBusy
default boolean isBusy()Whether 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.
-