public class CommandQueue
extends java.lang.Object
Constructor and Description |
---|
CommandQueue(@NotNull CrossfireServerConnection crossfireServerConnection,
@NotNull GuiStateManager guiStateManager,
@NotNull PendingDirections pendingDirections)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addToRepeatCount(int digit)
Adds a digit to the current repeat count.
|
boolean |
checkFire()
Returns whether the character is firing.
|
boolean |
checkRun()
Returns whether the character is running.
|
void |
sendMove(int to,
int tag)
Sends a "move" command to the server.
|
void |
sendNcom(boolean mustSend,
int repeat,
@NotNull java.lang.String command)
Sends a "ncom" command to the server.
|
void |
sendNcom(boolean mustSend,
@NotNull java.lang.String command)
Sends a "ncom" command to the server.
|
void |
sendRawString(@NotNull java.lang.String command)
Sends a raw command to the server.
|
boolean |
stopRunning()
Tells the server to stop running.
|
public CommandQueue(@NotNull @NotNull CrossfireServerConnection crossfireServerConnection, @NotNull @NotNull GuiStateManager guiStateManager, @NotNull @NotNull PendingDirections pendingDirections)
crossfireServerConnection
- the server connection for sending ncom
commandsguiStateManager
- the gui state manager to watchpendingDirections
- the pending directions instance to updatepublic void addToRepeatCount(int digit)
digit
- the digit (0-9) to addpublic void sendNcom(boolean mustSend, @NotNull @NotNull java.lang.String command)
mustSend
- if set, always send the command; if unset, drop the
command if the command queue is fullcommand
- the command to sendsendNcom(boolean, int, String)
public void sendNcom(boolean mustSend, int repeat, @NotNull @NotNull java.lang.String command)
mustSend
- if set, always send the command; if unset, drop the
command if the command queue is fullrepeat
- the repeat countcommand
- the command to sendsendNcom(boolean, String)
public void sendRawString(@NotNull @NotNull java.lang.String command)
command
- the command to sendsendNcom(boolean, String)
public boolean stopRunning()
public boolean checkRun()
public boolean checkFire()
public void sendMove(int to, int tag)
to
- the destination locationtag
- the item to move