Interface Action

All Known Implementing Classes:
MoveAction

public interface Action
Represents an executable action that an entity can perform within an Environment.

Actions define behavior such as moving, attacking, or interacting with the world. Each action determines whether it can be executed and performs logic when executed.

  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    canExecute(Environment environment, Entity entity)
    Checks whether this action can be executed by the specified entity in the given environment.
    void
    execute(Environment environment, Entity entity, float delta)
    Executes this action for the specified entity.
  • Method Details

    • canExecute

      boolean canExecute(Environment environment, Entity entity)
      Checks whether this action can be executed by the specified entity in the given environment.
      Parameters:
      environment - the environment in which the action would occur
      entity - the entity attempting to perform the action
      Returns:
      true if the action can be executed, otherwise false
    • execute

      void execute(Environment environment, Entity entity, float delta)
      Executes this action for the specified entity.
      Parameters:
      environment - the environment in which the action occurs
      entity - the entity performing the action
      delta - the frame delta time, used for time-based updates