Class ActionAttack

All Implemented Interfaces:
Action, RoleStateChange, IAnnotatedComponent, IComponentExecutionControl

public class ActionAttack extends ActionBase
  • Field Details

  • 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
    • activate

      public void activate(ExecutionSupport executionSupport, @Nullable InfoProvider infoProvider)
      Description copied from interface: Action
      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.
      Specified by:
      activate in interface Action
      Overrides:
      activate in class ActionBase
      Parameters:
      executionSupport - The execution support
      infoProvider - the InfoProvider from the parent sensor.
    • deactivate

      public void deactivate(ExecutionSupport executionSupport, @Nullable InfoProvider infoProvider)
      Description copied from interface: Action
      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.
      Specified by:
      deactivate in interface Action
      Overrides:
      deactivate in class ActionBase
      Parameters:
      executionSupport - The execution support
      infoProvider - the InfoProvider from the parent sensor.