public class CurrentSpellManager
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private Spell |
currentSpell
The currently selected spell, or
null . |
private EventListenerList2<CurrentSpellManagerListener> |
listeners
The listeners to notify object changed spell objects.
|
Constructor and Description |
---|
CurrentSpellManager() |
Modifier and Type | Method and Description |
---|---|
void |
addSpellListener(CurrentSpellManagerListener listener)
Adds a spell listener to be notified if the current spell object has
changed.
|
Spell |
getCurrentSpell()
Returns the currently selected spell object.
|
void |
removeSpellListener(CurrentSpellManagerListener listener)
Removes a spell listener.
|
void |
setCurrentSpell(Spell spell)
Sets the currently selected spell.
|
@Nullable private Spell currentSpell
null
.@NotNull private final EventListenerList2<CurrentSpellManagerListener> listeners
public void addSpellListener(@NotNull CurrentSpellManagerListener listener)
listener
- the listener to add@Nullable public Spell getCurrentSpell()
null
if no spell is selectedpublic void removeSpellListener(@NotNull CurrentSpellManagerListener listener)
listener
- the listener to removepublic void setCurrentSpell(@Nullable Spell spell)
spell
- the spell to selected