Class Invoke<A extends Actor>

  • All Implemented Interfaces:
    Action<A>

    public final class Invoke<A extends Actor>
    extends java.lang.Object
    implements Action<A>
    Invokes method or lambda code block as an action.
    • Constructor Summary

      Constructors 
      Constructor Description
      Invoke​(@NotNull java.lang.Runnable method)  
      Invoke​(@NotNull java.util.function.Consumer<@NotNull A> actorMethod)  
    • 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
    • Constructor Detail

      • Invoke

        public Invoke​(@NotNull
                      @NotNull java.lang.Runnable method)
      • Invoke

        public Invoke​(@NotNull
                      @NotNull java.util.function.Consumer<@NotNull A> actorMethod)
    • Method Detail

      • getActor

        @Nullable
        public A getActor()
        Specified by:
        getActor in interface Action<A extends Actor>
        Returns:
        actor that performs the action
      • setActor

        public void setActor​(@Nullable
                             A actor)
        Description copied from interface: Action
        Sets actor for the action
        Specified by:
        setActor in interface Action<A extends Actor>
        Parameters:
        actor - actor to be set for action
      • isDone

        public boolean isDone()
        Specified by:
        isDone in interface Action<A extends Actor>
        Returns:
        true if the action is done, false otherwise
      • 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.
        Specified by:
        execute in interface Action<A extends Actor>
        Parameters:
        deltaTime - time passed from the previous execution
      • reset

        public void reset()
        Description copied from interface: Action
        Resets the state of the action, except the assigned actor.
        Specified by:
        reset in interface Action<A extends Actor>