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 TypeMethodDescriptionbooleancanExecute(Environment environment, Entity entity) Checks whether this action can be executed by the specified entity in the given environment.voidexecute(Environment environment, Entity entity, float delta) Executes this action for the specified entity.
-
Method Details
-
canExecute
Checks whether this action can be executed by the specified entity in the given environment.- Parameters:
environment- the environment in which the action would occurentity- the entity attempting to perform the action- Returns:
trueif the action can be executed, otherwisefalse
-
execute
Executes this action for the specified entity.- Parameters:
environment- the environment in which the action occursentity- the entity performing the actiondelta- the frame delta time, used for time-based updates
-