22 package com.realtime.crossfire.jxclient.commands;
26 import org.jetbrains.annotations.NotNull;
46 super(
"unbind", crossfireServerConnection);
62 public void execute(@NotNull
final String args) {
63 final CharSequence commands;
64 final boolean perCharacterBinding;
65 if (args.equals(
"-c")) {
66 perCharacterBinding =
true;
68 }
else if (args.startsWith(
"-c ")) {
69 perCharacterBinding =
true;
70 commands = args.substring(3).trim();
72 perCharacterBinding =
false;
76 if (commands.length() != 0) {
82 drawInfoError(
"Cannot use unbind -c since no character is logged in.");
Abstract base class for Command implementations.
boolean removeKeyBinding(boolean perCharacter)
Removes a key binding.
UnbindCommand(@NotNull final CommandCallback commandCallback, @NotNull final CrossfireServerConnection crossfireServerConnection)
Creates a new instance.
void drawInfoError(@NotNull final String message)
Displays an error message.
final CrossfireServerConnection crossfireServerConnection
The connection instance.
boolean allArguments()
Returns whether all remaining commands should be included as arguments.whether all remaining commands...
Interface that defines callback functions needed by commands.
Implements the "unbind" command.
Adds encoding/decoding of crossfire protocol packets to a ServerConnection.
void execute(@NotNull final String args)
Executes the command with the given arguments.the command arguments
final CommandCallback commandCallback
The CommandCallback to use.