Interface IActionQueue


  • public interface IActionQueue
    • Method Detail

      • start

        IActionQueue start()
        Returns:
        starts the processing of scheduled IActions in queue. Queue is on by default
      • stop

        IActionQueue stop()
        Returns:
        pauses the processing of scheduled IActions
      • getName

        java.lang.String getName()
      • isParallel

        boolean isParallel()
        Returns:
        True if parallel, else is sequential
      • getQueue

        java.util.Queue<IAction> getQueue()
        Returns:
        actual java queue which stores all scheduled IActions
      • setParallel

        IActionQueue setParallel​(boolean parallel)
        Parameters:
        parallel - True to turn queue into parallel, false for sequential
        Returns:
      • isStoppedWhenEmpty

        boolean isStoppedWhenEmpty()
        Returns:
        If true, auto-stops queue when empty/no active Actions scheduled using {stop()}
      • stopWhenEmpty

        IActionQueue stopWhenEmpty​(boolean stopWhenEmpty)
        Parameters:
        stopWhenEmpty - to auto-stop queue when empty/no active Actions scheduled using {stop()}
        Returns:
      • isKilledWhenEmpty

        boolean isKilledWhenEmpty()
        Returns:
        True to auto-remove this queue from the IActionManager when no IActions are scheduled or queue is empty Default: true
      • getKillWhenEmptyAfter

        int getKillWhenEmptyAfter()
        Returns:
        ticks it takes to remove this queue from IActionManager after {isKilledWhenEmpty()} is satisfied If an IAction is scheduled after it's satisfied, the kill process is aborted. Default: 100 ticks
      • killWhenEmpty

        IActionQueue killWhenEmpty​(boolean killWhenEmpty)
      • killWhenEmptyAfter

        IActionQueue killWhenEmptyAfter​(int ticks)
        Parameters:
        ticks - to kill queue after when killWhenEmpty and queue has no active tasks If an IAction is scheduled during the kill process, process is aborted
        Returns:
      • isDead

        boolean isDead()
        Returns:
        True if queue was removed from IActionManager or killed
      • kill

        IActionQueue kill()
        Returns:
        kills queue and removes it from IActionManager immediately
      • schedule

        void schedule​(IAction... actions)
      • schedule

        void schedule​(java.util.function.Consumer<IAction>... tasks)
      • schedule

        IAction schedule​(java.util.function.Consumer<IAction> task)
      • schedule

        IAction schedule​(int delay,
                         java.util.function.Consumer<IAction> task)
      • schedule

        IAction schedule​(int maxDuration,
                         int delay,
                         java.util.function.Consumer<IAction> task)
      • schedule

        IAction schedule​(java.lang.String name,
                         java.util.function.Consumer<IAction> task)
      • schedule

        IAction schedule​(java.lang.String name,
                         int delay,
                         java.util.function.Consumer<IAction> task)
      • schedule

        IAction schedule​(java.lang.String name,
                         int maxDuration,
                         int delay,
                         java.util.function.Consumer<IAction> task)
      • scheduleActionAt

        IAction scheduleActionAt​(int index,
                                 IAction action)
      • hasActiveTasks

        boolean hasActiveTasks()
      • getIndex

        int getIndex​(IAction action)
        Parameters:
        action -
        Returns:
        index of action in {getQueue()} -1 if not in queue.
      • getCurrentAction

        IAction getCurrentAction()
        Returns:
        current IAction the queue is at. For sequential use.
      • has

        boolean has​(IAction action)
      • has

        boolean has​(java.lang.String actionName)
      • get

        IAction get​(java.lang.String actionName)
      • cancel

        boolean cancel​(IAction action)
      • cancel

        boolean cancel​(java.lang.String actionName)
      • clear

        void clear()
        Kills all IActions in {getQueue()} and empties it
      • chain

        IActionChain chain()
        Returns:
        an IActionChain based on this queue. If {isParallel()}, returns a parallel IActionChain
      • printQueue

        java.lang.String printQueue()
        Returns:
        a string containing all the scheduled actions within this queue