22 package com.realtime.crossfire.jxclient.shortcuts;
28 import org.jetbrains.annotations.NotNull;
40 private static final String
CAST =
"cast ";
46 private static final String
INVOKE =
"invoke ";
97 return command ==
CAST;
105 final String newCommand = cast ?
CAST :
INVOKE;
106 if (command == newCommand) {
110 command = newCommand;
static final String CAST
Command prefix to "cast" a spell.
String command
The command for casting the spell.
void setCast(final boolean cast)
Sets whether the spell should be "cast" or "invoked".
void sendNcom(final boolean mustSend, @NotNull final String command)
Sends an "ncom" command to the server.
static final String INVOKE
Command prefix to "invoke" a spell.
Manages image information ("faces") needed to display the map view, items, and spell icons...
int getFaceNum()
Returns the face number.
void visit(@NotNull final ShortcutVisitor visitor)
boolean isUnknown()
Returns whether this spell is unknown to the character.
final Spell spell
The spell to cast.
void addSpellListener(@NotNull final SpellListener listener)
Adds a SpellListener to be notified of changes.
Describes a Crossfire spell.
int getTag()
Returns the tag ID.
void fireModifiedEvent()
Notifies all listeners about a modification.
String getTooltipText()
Returns a description for this spell to be used in tooltips.
final SpellListener spellListener
The SpellListener attached to spell.
ShortcutSpell(@NotNull final CommandQueue commandQueue, @NotNull final Spell spell)
Creates a new instance.
Interface for visitors of Shortcut instances.
final CommandQueue commandQueue
The command queue for executing commands.
boolean isCast()
Returns whether the spell should be "cast" or "invoked".
Spell getSpell()
Returns the spell to cast.
void removeSpellListener(@NotNull final SpellListener listener)
Removes a SpellListener to be notified of changes.
Abstract base class for shortcut commands.
A Shortcut that casts a spell.
Maintains the pending (ncom) commands sent to the server.
boolean displaysFace(final Face face)
int getFaceNum()
Returns the unique face id.
Interface for listeners interested in Spell related events.