Package sk.tuke.kpi.gamelib.actions
Class When<A extends Actor>
- java.lang.Object
-
- sk.tuke.kpi.gamelib.actions.When<A>
-
- All Implemented Interfaces:
Action<A>
public final class When<A extends Actor> extends java.lang.Object implements Action<A>
Executes the given action one time, once the predicate becomestrue
.The constructor expects either a predicate that accepts
When
action as a parameter, or a parameter-less predicate.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
execute(float deltaTime)
Executes (one step of) the action.A
getActor()
boolean
isDone()
void
reset()
Resets the state of the action, except the assigned actor.void
setActor(A actor)
Sets actor for the action-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface sk.tuke.kpi.gamelib.actions.Action
scheduleFor, scheduleOn
-
-
-
-
Method Detail
-
getActor
@Nullable public A getActor()
-
setActor
public void setActor(@Nullable A actor)
Description copied from interface:Action
Sets actor for the action
-
isDone
public boolean isDone()
-
execute
public void execute(float deltaTime)
Description copied from interface:Action
Executes (one step of) the action. Called by the scene this action was scheduled on, prior to rendering.
-
-