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 Details

    • EMPTY_ARRAY

      static final Action[] 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 ref
      executionSupport - The execution support
      sensorInfo - SensorInfo with PositionProvider, PathProvider, etc if required
      dt - The interval in seconds for this calculation
      store - 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 ref
      executionSupport - The execution support
      sensorInfo - SensorInfo with PositionProvider, PathProvider, etc if required
      dt - The interval in seconds for this calculation
      store - The component store
      Returns:
      true when executed action has finished else false when execution is not completed yet
    • activate

      void activate(ExecutionSupport executionSupport, InfoProvider infoProvider)
      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 support
      infoProvider - the InfoProvider from the parent sensor.
    • deactivate

      void deactivate(ExecutionSupport executionSupport, InfoProvider infoProvider)
      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 support
      infoProvider - the InfoProvider from the parent sensor.
    • isActivated

      boolean isActivated()
      Checks if this action has been activated.
      Returns:
      true if activated, false if 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 by ForEach's per-target instance pool to avoid recycling a slot whose action is still mid-execution. Defaults to false.