Class CommandQueue
java.lang.Object
com.realtime.crossfire.jxclient.queue.CommandQueue
Maintains the pending (ncom) commands sent to the server.
-
Constructor Summary
ConstructorsConstructorDescriptionCommandQueue(@NotNull CrossfireServerConnection crossfireServerConnection, @NotNull GuiStateManager guiStateManager, @NotNull PendingDirections pendingDirections) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddToRepeatCount(int digit) Adds a digit to the current repeat count.booleanReturns whether the character is firing.booleancheckRun()Returns whether the character is running.voidsendMove(int to, int tag) Sends a "move" command to the server.voidSends a "ncom" command to the server.voidSends a "ncom" command to the server.voidsendRawString(@NotNull String command) Sends a raw command to the server.booleanTells the server to stop running.
-
Constructor Details
-
CommandQueue
public CommandQueue(@NotNull @NotNull CrossfireServerConnection crossfireServerConnection, @NotNull @NotNull GuiStateManager guiStateManager, @NotNull @NotNull PendingDirections pendingDirections) Creates a new instance.- Parameters:
crossfireServerConnection- the server connection for sending ncom commandsguiStateManager- the gui state manager to watchpendingDirections- the pending directions instance to update
-
-
Method Details
-
addToRepeatCount
public void addToRepeatCount(int digit) Adds a digit to the current repeat count.- Parameters:
digit- the digit (0-9) to add
-
sendNcom
Sends a "ncom" command to the server. This function uses the default repeat count.- Parameters:
mustSend- if set, always send the command; if unset, drop the command if the command queue is fullcommand- the command to send- See Also:
-
sendNcom
Sends a "ncom" command to the server.- Parameters:
mustSend- if set, always send the command; if unset, drop the command if the command queue is fullrepeat- the repeat countcommand- the command to send- See Also:
-
sendRawString
Sends a raw command to the server.- Parameters:
command- the command to send- See Also:
-
stopRunning
public boolean stopRunning()Tells the server to stop running. If the character is not running, does nothing.- Returns:
- whether running was active
-
checkRun
public boolean checkRun()Returns whether the character is running.- Returns:
- whether the character is running
-
checkFire
public boolean checkFire()Returns whether the character is firing.- Returns:
- whether the character is firing
-
sendMove
public void sendMove(int to, int tag) Sends a "move" command to the server. The repeat count value is the client's current repeat count.- Parameters:
to- the destination locationtag- the item to move
-