Class ActionEntityHitInteraction

All Implemented Interfaces:
Action, RoleStateChange, IAnnotatedComponent, IComponentExecutionControl

public class ActionEntityHitInteraction extends ActionBase
Iterates the EntityHit list provided by an EntityCollisionProvider and queues a configurable RootInteraction chain against each hit entity. The chain is fired with InteractionType.Collision, matching the semantics of the rail-step collision report.

The per-hit context is built with the charger as the running entity and the hit entity exposed via Interaction.TARGET_ENTITY, matching the convention used by built-in combat assets (see e.g. Skeleton_Burnt_Praetorian_Charge.json). Target-aware interactions such as DamageEntity will act on the hit entity through context.getTargetEntity(); self-acting interactions such as ApplyForce will act on the charger.

  • Constructor Details

  • 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: Action
      Test if an action can be executed
      Specified by:
      canExecute in interface Action
      Overrides:
      canExecute in class ActionBase
      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

      public boolean execute(@Nonnull Ref<EntityStore> ref, @Nonnull ExecutionSupport executionSupport, @Nullable InfoProvider sensorInfo, double dt, @Nonnull Store<EntityStore> store)
      Description copied from interface: Action
      Execute action
      Specified by:
      execute in interface Action
      Overrides:
      execute in class ActionBase
      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