mirror of
https://github.com/KAMKEEL/CustomNPC-Plus-API.git
synced 2026-11-16 02:34:43 +00:00
IActionQueue documentation
This commit is contained in:
1 parent
a0d5aa7a8c
commit
1023ec029f
1 file changed
+35
-1
@@ -6,18 +6,38 @@ import java.util.Queue;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
public interface IActionQueue {
|
||||
|
||||
/**
|
||||
* @return starts the processing of scheduled IActions in queue.
|
||||
* Queue is on by default
|
||||
*/
|
||||
IActionQueue start();
|
||||
|
||||
/**
|
||||
* @return pauses the processing of scheduled IActions
|
||||
*/
|
||||
IActionQueue stop();
|
||||
|
||||
IActionManager getManager();
|
||||
|
||||
String getName();
|
||||
|
||||
/**
|
||||
* @return True if parallel, else is sequential
|
||||
*/
|
||||
boolean isParallel();
|
||||
|
||||
/**
|
||||
*
|
||||
* @return actual java queue which stores all scheduled IActions
|
||||
*/
|
||||
Queue<IAction> getQueue();
|
||||
|
||||
/**
|
||||
*
|
||||
* @param parallel True to turn queue into parallel, false for sequential
|
||||
* @return
|
||||
*/
|
||||
IActionQueue setParallel(boolean parallel);
|
||||
|
||||
/**
|
||||
@@ -36,7 +56,7 @@ public interface IActionQueue {
|
||||
IActionQueue killWhenEmpty(boolean killWhenEmpty);
|
||||
|
||||
/**
|
||||
* @param ticks to kill queue after when queue has no active tasks
|
||||
* @param 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
|
||||
* @return
|
||||
*/
|
||||
@@ -69,8 +89,18 @@ public interface IActionQueue {
|
||||
|
||||
IAction scheduleActionAt(int index, IAction action);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param action
|
||||
* @return index of action in {{@link #getQueue()}}
|
||||
* -1 if not in queue.
|
||||
*/
|
||||
int getIndex(IAction action);
|
||||
|
||||
/**
|
||||
*
|
||||
* @return current IAction the queue is at. For sequential use.
|
||||
*/
|
||||
IAction getCurrentAction();
|
||||
|
||||
boolean has(IAction action);
|
||||
@@ -83,10 +113,14 @@ public interface IActionQueue {
|
||||
|
||||
boolean cancel(String actionName);
|
||||
|
||||
/**
|
||||
* Kills all IActions in {{@link #getQueue()}} and empties it
|
||||
*/
|
||||
void clear();
|
||||
|
||||
/**
|
||||
* @return an IActionChain based on this queue.
|
||||
* If {{@link #isParallel()}}, returns a parallel IActionChain
|
||||
*/
|
||||
|
||||
IActionChain chain();
|
||||
|
||||
Reference in new issue
Block a user