Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
ShortcutSpell(CommandQueue commandQueue,
Spell spell)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
boolean |
displaysFace(Face face)
Returns whether this shortcut displays the given face.
|
void |
dispose()
Releases all allocated resources.
|
void |
execute()
Executes the shortcut.
|
Spell |
getSpell()
Returns the spell to cast.
|
java.lang.String |
getTooltipText()
Returns the current tooltip text.
|
boolean |
isCast()
Returns whether the spell should be "cast" or "invoked".
|
void |
setCast(boolean cast)
Sets whether the spell should be "cast" or "invoked".
|
void |
visit(ShortcutVisitor visitor)
Calls a
ShortcutVisitor 's visit() function for this
instance. |
addShortcutListener, fireModifiedEvent, removeShortcutListener
@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
.public ShortcutSpell(@NotNull CommandQueue commandQueue, @NotNull Spell spell)
commandQueue
- the command queue for executing commandsspell
- the spell to castpublic boolean displaysFace(Face face)
displaysFace
in class Shortcut
face
- the face to check forpublic void dispose()
@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.