Class CommandQueue
- java.lang.Object
-
- com.realtime.crossfire.jxclient.queue.CommandQueue
-
public class CommandQueue extends java.lang.ObjectMaintains the pending (ncom) commands sent to the server.
-
-
Constructor Summary
Constructors Constructor Description CommandQueue(@NotNull CrossfireServerConnection crossfireServerConnection, @NotNull GuiStateManager guiStateManager)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddToRepeatCount(int digit)Adds a digit to the current repeat count.booleancheckFire()Returns whether the character is firing.booleancheckRun()Returns whether the character is running.voidresetRepeatCount()Resets the current repeat count to zero.voidsendMove(int to, int tag)Sends a "move" command to the server.voidsendNcom(boolean mustSend, int repeat, @NotNull java.lang.String command)Sends an "ncom" command to the server.voidsendNcom(boolean mustSend, @NotNull java.lang.String command)Sends an "ncom" command to the server.voidsendRawString(@NotNull java.lang.String command)Sends a raw command to the server.booleanstopRunning()Tells the server to stop running.
-
-
-
Constructor Detail
-
CommandQueue
public CommandQueue(@NotNull @NotNull CrossfireServerConnection crossfireServerConnection, @NotNull @NotNull GuiStateManager guiStateManager)Creates a new instance.- Parameters:
crossfireServerConnection- the server connection for sending ncom commandsguiStateManager- the gui state manager to watch
-
-
Method Detail
-
resetRepeatCount
public void resetRepeatCount()
Resets the current repeat count to zero.
-
addToRepeatCount
public void addToRepeatCount(int digit)
Adds a digit to the current repeat count.- Parameters:
digit- the digit (0-9) to add
-
sendNcom
public void sendNcom(boolean mustSend, @NotNull @NotNull java.lang.String command)Sends an "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(boolean, int, String)
-
sendNcom
public void sendNcom(boolean mustSend, int repeat, @NotNull @NotNull java.lang.String command)Sends an "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:
sendNcom(boolean, String)
-
sendRawString
public void sendRawString(@NotNull @NotNull java.lang.String command)Sends a raw command to the server.- Parameters:
command- the command to send- See Also:
sendNcom(boolean, String)
-
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
- No Inspection:
- MethodMayBeStatic
-
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
-
-