22 package com.realtime.crossfire.jxclient.commands;
27 import org.jetbrains.annotations.NotNull;
55 super(
"again", crossfireServerConnection);
72 public void execute(@NotNull
final String args) {
73 if (!args.isEmpty()) {
74 drawInfoError(
"The 'again' command does not take any arguments.");
80 final CharSequence command = commandHistory.
last(index);
81 if (command == null) {
86 if (!command.equals(
"again")) {
Abstract base class for Command implementations.
void executeCommand(@NotNull final CharSequence commandLine)
Executes a command or a list of commands.
void drawInfoError(@NotNull final String message)
Displays an error message.
final CrossfireServerConnection crossfireServerConnection
The connection instance.
Implements the "again" command.
CharSequence last(final int index)
Returns the last executed command.
final CommandHistory commandHistory
The CommandHistory for determining the command to execute.
AgainCommand(@NotNull final CrossfireServerConnection crossfireServerConnection, @NotNull final CommandExecutor commandExecutor, @NotNull final CommandHistory commandHistory)
Creates a new instance.
boolean allArguments()
Returns whether all remaining commands should be included as arguments.whether all remaining commands...
final CommandExecutor commandExecutor
The CommandExecutor for executing the commands.
void execute(@NotNull final String args)
Executes the command with the given arguments.the command arguments
Manages a list of previously entered commands.
Adds encoding/decoding of crossfire protocol packets to a ServerConnection.