java.lang.Object com.realtime.crossfire.jxclient.shortcuts.Shortcut com.realtime.crossfire.jxclient.shortcuts.ShortcutSpell
public class ShortcutSpell
A Shortcut
that casts a spell.
Field Summary | |
---|---|
private static java.lang.String |
CAST
Command prefix to "cast" a spell. |
private java.lang.String |
command
The command for casting the spell. |
private CommandQueue |
commandQueue
The command queue for executing commands. |
private static java.lang.String |
INVOKE
Command prefix to "invoke" a spell. |
private Spell |
spell
The spell to cast. |
private SpellListener |
spellListener
The SpellListener attached to spell . |
Constructor Summary | |
---|---|
ShortcutSpell(CommandQueue commandQueue,
Spell spell)
Creates a new instance. |
Method Summary | |
---|---|
boolean |
displaysFace(Face face)
Returns whether this shortcut displays the given face. |
void |
dispose()
Releases all allocated resources. |
void |
execute()
Execute the shortcut. |
Spell |
getSpell()
Return the spell to cast. |
java.lang.String |
getTooltipText()
Returns the current tooltip text. |
boolean |
isCast()
Return whether the spell should be "cast" or "invoked". |
void |
setCast(boolean cast)
Set whether the spell should be "cast" or "invoked". |
void |
visit(ShortcutVisitor visitor)
Calls a ShortcutVisitor 's visit() function for this
instance. |
Methods inherited from class com.realtime.crossfire.jxclient.shortcuts.Shortcut |
---|
addShortcutListener, fireModifiedEvent, removeShortcutListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
@NotNull private static final java.lang.String CAST
@NotNull private java.lang.String command
@NotNull private final CommandQueue commandQueue
@NotNull private static final java.lang.String INVOKE
@NotNull private final Spell spell
@NotNull private final SpellListener spellListener
SpellListener
attached to spell
.
Constructor Detail |
---|
public ShortcutSpell(@NotNull CommandQueue commandQueue, @NotNull Spell spell)
commandQueue
- the command queue for executing commandsspell
- the spell to castMethod Detail |
---|
public boolean displaysFace(Face face)
displaysFace
in class Shortcut
face
- the face to check for
public void dispose()
dispose
in class Shortcut
public void execute()
execute
in class Shortcut
@NotNull public Spell getSpell()
@NotNull public java.lang.String getTooltipText()
getTooltipText
in class Shortcut
public boolean isCast()
true
for "cast", or false
for
"invoke".public void setCast(boolean cast)
cast
- true
for "cast", or false
for
"invoke".public void visit(@NotNull ShortcutVisitor visitor)
ShortcutVisitor
's visit()
function for this
instance.
visit
in class Shortcut
visitor
- the visitor to call