Crossfire JXClient, Trunk
|
Public Member Functions | |
void | addCrossfireSpellChangedListener (@NotNull final SpellsManagerListener listener) |
void | addSpell (final int tag, final int level, final int castingTime, final int mana, final int grace, final int damage, final int skill, final int path, final int faceNum, @NotNull final String spellName, @NotNull final String message) |
void | deleteSpell (final int tag) |
boolean | displaysFace (final int faceNum) |
void | filterSkill (final int index) |
Collection< Spell > | getAllSpells () |
Spell | getFilteredSpell (final int index) |
Collection< Spell > | getFilteredSpells () |
int | getFilteredSpellsCount () |
Spell | getSpell (@NotNull final String spellName) |
Skill | getSpellSkill (final int index) |
int | getSpellSkills () |
void | removeCrossfireSpellChangedListener (@NotNull final SpellsManagerListener listener) |
void | selectCharacter () |
SpellsManager (@NotNull final GuiStateManager guiStateManager, @NotNull final SkillSet skillSet, @NotNull final Stats stats) | |
void | updateSpell (final int flags, final int tag, final int mana, final int grace, final int damage) |
Static Public Attributes | |
static final int | UPD_SP_DAMAGE = 4 |
static final int | UPD_SP_GRACE = 2 |
static final int | UPD_SP_MANA = 1 |
Private Member Functions | |
void | deleteSpellByIndex (final int index) |
void | filterSpells () |
void | rebuildSkills () |
Private Attributes | |
final List< Spell > | filteredSpells = new CopyOnWriteArrayList<>() |
final GuiStateListener | guiStateListener |
final EventListenerList2< SpellsManagerListener > | listeners = new EventListenerList2<>() |
final Skill | skillAll = new Skill("All spell skills") |
int | skillFilter = -1 |
final SkillSet | skillSet |
final Comparator< Spell > | spellNameComparator = new SpellComparator() |
final List< Spell > | spells = new CopyOnWriteArrayList<>() |
final List< Skill > | spellSkills = new ArrayList<>() |
final Stats | stats |
final Map< String, Spell > | unknownSpells = new HashMap<>() |
Manages all known spells. Spells are filtered by skill through the function filterSkill().
Definition at line 50 of file SpellsManager.java.
com.realtime.crossfire.jxclient.spells.SpellsManager.SpellsManager | ( | @NotNull final GuiStateManager | guiStateManager, |
@NotNull final SkillSet | skillSet, | ||
@NotNull final Stats | stats | ||
) |
Creates a new instance.
guiStateManager | the gui state manager to watch |
skillSet | skills the players knows |
stats | the stats for the player |
Definition at line 179 of file SpellsManager.java.
References com.realtime.crossfire.jxclient.spells.SpellsManager.guiStateListener, com.realtime.crossfire.jxclient.spells.SpellsManager.skillSet, and com.realtime.crossfire.jxclient.spells.SpellsManager.stats.
void com.realtime.crossfire.jxclient.spells.SpellsManager.addCrossfireSpellChangedListener | ( | @NotNull final SpellsManagerListener | listener | ) |
Adds a SpellsManagerListener to notify about changes.
listener | the listener to add |
Definition at line 189 of file SpellsManager.java.
References com.realtime.crossfire.jxclient.spells.SpellsManager.listeners.
Referenced by com.realtime.crossfire.jxclient.items.SpellSkillView.SpellSkillView(), and com.realtime.crossfire.jxclient.items.SpellsView.SpellsView().
void com.realtime.crossfire.jxclient.spells.SpellsManager.addSpell | ( | final int | tag, |
final int | level, | ||
final int | castingTime, | ||
final int | mana, | ||
final int | grace, | ||
final int | damage, | ||
final int | skill, | ||
final int | path, | ||
final int | faceNum, | ||
@NotNull final String | spellName, | ||
@NotNull final String | message | ||
) |
Adds a new spell. Re-uses entries from unknownSpells if possible.
tag | the spell's tag |
level | the spell's level |
castingTime | the spell's casting time |
mana | the spell's mana cost |
grace | the spell's grace cost |
damage | the spell's damage |
skill | the spell's skill |
path | the spell's path |
faceNum | the spell's face number |
spellName | the spell's name |
message | the spells' description |
Definition at line 216 of file SpellsManager.java.
References com.realtime.crossfire.jxclient.spells.SpellsManager.filterSpells(), com.realtime.crossfire.jxclient.spells.SpellsManager.listeners, com.realtime.crossfire.jxclient.spells.SpellsManager.rebuildSkills(), com.realtime.crossfire.jxclient.spells.Spell.setParameters(), com.realtime.crossfire.jxclient.spells.SpellsManager.skillSet, com.realtime.crossfire.jxclient.spells.SpellsManager.spellNameComparator, com.realtime.crossfire.jxclient.spells.SpellsManager.spells, com.realtime.crossfire.jxclient.spells.SpellsManager.stats, and com.realtime.crossfire.jxclient.spells.SpellsManager.unknownSpells.
Referenced by com.realtime.crossfire.jxclient.server.crossfire.DefaultCrossfireServerConnection.processAddSpell().
void com.realtime.crossfire.jxclient.spells.SpellsManager.deleteSpell | ( | final int | tag | ) |
Deletes a spell.
tag | the spell's tag |
Definition at line 269 of file SpellsManager.java.
References com.realtime.crossfire.jxclient.spells.SpellsManager.deleteSpellByIndex(), com.realtime.crossfire.jxclient.spells.SpellsManager.filterSpells(), com.realtime.crossfire.jxclient.spells.SpellsManager.rebuildSkills(), and com.realtime.crossfire.jxclient.spells.SpellsManager.spells.
Referenced by com.realtime.crossfire.jxclient.server.crossfire.DefaultCrossfireServerConnection.processDelSpell().
|
private |
Deletes a spell by index into spells.
index | the index to delete |
Definition at line 286 of file SpellsManager.java.
References com.realtime.crossfire.jxclient.spells.Spell.getName(), com.realtime.crossfire.jxclient.spells.SpellsManager.listeners, com.realtime.crossfire.jxclient.spells.SpellsManager.rebuildSkills(), com.realtime.crossfire.jxclient.spells.Spell.setUnknown(), com.realtime.crossfire.jxclient.spells.SpellsManager.spells, and com.realtime.crossfire.jxclient.spells.SpellsManager.unknownSpells.
Referenced by com.realtime.crossfire.jxclient.spells.SpellsManager.deleteSpell().
boolean com.realtime.crossfire.jxclient.spells.SpellsManager.displaysFace | ( | final int | faceNum | ) |
Returns whether any spell has the given face.
faceNum | the face |
Definition at line 375 of file SpellsManager.java.
References com.realtime.crossfire.jxclient.spells.SpellsManager.spells.
Referenced by com.realtime.crossfire.jxclient.items.SpellSkillView.SpellSkillView(), and com.realtime.crossfire.jxclient.items.SpellsView.SpellsView().
void com.realtime.crossfire.jxclient.spells.SpellsManager.filterSkill | ( | final int | index | ) |
Filters spells to display by the specified skill index.
index | the skill index, should be less than getSpellSkills() |
Definition at line 397 of file SpellsManager.java.
References com.realtime.crossfire.jxclient.spells.SpellsManager.filterSpells(), com.realtime.crossfire.jxclient.skills.SkillSet.getSkillId(), com.realtime.crossfire.jxclient.spells.SpellsManager.listeners, com.realtime.crossfire.jxclient.spells.SpellsManager.skillFilter, com.realtime.crossfire.jxclient.spells.SpellsManager.skillSet, and com.realtime.crossfire.jxclient.spells.SpellsManager.spellSkills.
Referenced by com.realtime.crossfire.jxclient.gui.list.GUISpellSkillList.selectionChanged().
|
private |
Rebuilds the list of spells to display.
Definition at line 419 of file SpellsManager.java.
References com.realtime.crossfire.jxclient.spells.SpellsManager.filteredSpells, com.realtime.crossfire.jxclient.spells.SpellsManager.skillFilter, and com.realtime.crossfire.jxclient.spells.SpellsManager.spells.
Referenced by com.realtime.crossfire.jxclient.spells.SpellsManager.addSpell(), com.realtime.crossfire.jxclient.spells.SpellsManager.deleteSpell(), and com.realtime.crossfire.jxclient.spells.SpellsManager.filterSkill().
Collection<Spell> com.realtime.crossfire.jxclient.spells.SpellsManager.getAllSpells | ( | ) |
Returns all known spells.
Definition at line 334 of file SpellsManager.java.
References com.realtime.crossfire.jxclient.spells.SpellsManager.filteredSpells.
Referenced by com.realtime.crossfire.jxclient.scripts.AbstractScriptProcess.cmdRequest().
Spell com.realtime.crossfire.jxclient.spells.SpellsManager.getFilteredSpell | ( | final int | index | ) |
Returns a Spell instance by index. Considers only currently shown spells.
index | the index |
Definition at line 362 of file SpellsManager.java.
References com.realtime.crossfire.jxclient.spells.SpellsManager.filteredSpells.
Referenced by com.realtime.crossfire.jxclient.items.SpellsView.getItem(), com.realtime.crossfire.jxclient.gui.list.GUISpellList.getTooltip(), and com.realtime.crossfire.jxclient.gui.item.GUIItemSpell.setSpell().
Collection<Spell> com.realtime.crossfire.jxclient.spells.SpellsManager.getFilteredSpells | ( | ) |
Returns all currently shown spells.
Definition at line 343 of file SpellsManager.java.
References com.realtime.crossfire.jxclient.spells.SpellsManager.filteredSpells.
int com.realtime.crossfire.jxclient.spells.SpellsManager.getFilteredSpellsCount | ( | ) |
Returns the number of currently shown spells.
Definition at line 351 of file SpellsManager.java.
References com.realtime.crossfire.jxclient.spells.SpellsManager.filteredSpells.
Referenced by com.realtime.crossfire.jxclient.gui.item.GUIItemSpellSkill.canScroll(), com.realtime.crossfire.jxclient.gui.item.GUIItemSpell.canScroll(), com.realtime.crossfire.jxclient.items.SpellsView.getSize(), and com.realtime.crossfire.jxclient.items.SpellsView.SpellsView().
Spell com.realtime.crossfire.jxclient.spells.SpellsManager.getSpell | ( | @NotNull final String | spellName | ) |
Returns a Spell instance by partial spell name.
spellName | the spell name to find |
Definition at line 307 of file SpellsManager.java.
References com.realtime.crossfire.jxclient.spells.SpellsManager.spells.
Referenced by com.realtime.crossfire.jxclient.shortcuts.Shortcuts.setShortcutString().
Skill com.realtime.crossfire.jxclient.spells.SpellsManager.getSpellSkill | ( | final int | index | ) |
Returns the specified spell skill.
index | the skill index, from 0 to getSpellSkills()-1 |
Definition at line 453 of file SpellsManager.java.
References com.realtime.crossfire.jxclient.spells.SpellsManager.spellSkills.
Referenced by com.realtime.crossfire.jxclient.items.SpellSkillView.getItem(), com.realtime.crossfire.jxclient.gui.list.GUISpellSkillList.getTooltip(), and com.realtime.crossfire.jxclient.gui.item.GUIItemSpellSkill.setSkill().
int com.realtime.crossfire.jxclient.spells.SpellsManager.getSpellSkills | ( | ) |
Returns the number of spell skills.
Definition at line 443 of file SpellsManager.java.
References com.realtime.crossfire.jxclient.spells.SpellsManager.spellSkills.
Referenced by com.realtime.crossfire.jxclient.items.SpellSkillView.getSize(), and com.realtime.crossfire.jxclient.items.SpellSkillView.SpellSkillView().
|
private |
Rebuilds the list of skills from the spells.
Definition at line 427 of file SpellsManager.java.
References com.realtime.crossfire.jxclient.skills.SkillSet.getSkill(), com.realtime.crossfire.jxclient.spells.SpellsManager.skillAll, com.realtime.crossfire.jxclient.spells.SpellsManager.skillSet, com.realtime.crossfire.jxclient.spells.SpellsManager.spells, com.realtime.crossfire.jxclient.spells.SpellsManager.spellSkills, and com.realtime.crossfire.jxclient.skills.Skill.toString().
Referenced by com.realtime.crossfire.jxclient.spells.SpellsManager.addSpell(), com.realtime.crossfire.jxclient.spells.SpellsManager.deleteSpell(), and com.realtime.crossfire.jxclient.spells.SpellsManager.deleteSpellByIndex().
void com.realtime.crossfire.jxclient.spells.SpellsManager.removeCrossfireSpellChangedListener | ( | @NotNull final SpellsManagerListener | listener | ) |
Removes a SpellsManagerListener to notify about changes.
listener | the listener to remove |
Definition at line 197 of file SpellsManager.java.
References com.realtime.crossfire.jxclient.spells.SpellsManager.listeners.
Referenced by com.realtime.crossfire.jxclient.gui.item.GUIItemSpellSkill.dispose(), and com.realtime.crossfire.jxclient.gui.item.GUIItemSpell.dispose().
void com.realtime.crossfire.jxclient.spells.SpellsManager.selectCharacter | ( | ) |
A character name was sent to the server.
Definition at line 388 of file SpellsManager.java.
References com.realtime.crossfire.jxclient.spells.SpellsManager.filteredSpells, and com.realtime.crossfire.jxclient.spells.SpellsManager.spells.
Referenced by com.realtime.crossfire.jxclient.server.crossfire.AbstractCrossfireServerConnection.fireSelectCharacter().
void com.realtime.crossfire.jxclient.spells.SpellsManager.updateSpell | ( | final int | flags, |
final int | tag, | ||
final int | mana, | ||
final int | grace, | ||
final int | damage | ||
) |
Updates spell information.
flags | specifies which fields to update |
tag | the spell's tag |
mana | the spell's new mana cost |
grace | the spell's new grace cost |
damage | the spell's new damage |
Definition at line 256 of file SpellsManager.java.
References com.realtime.crossfire.jxclient.spells.SpellsManager.spells, com.realtime.crossfire.jxclient.spells.SpellsManager.UPD_SP_DAMAGE, com.realtime.crossfire.jxclient.spells.SpellsManager.UPD_SP_GRACE, and com.realtime.crossfire.jxclient.spells.SpellsManager.UPD_SP_MANA.
Referenced by com.realtime.crossfire.jxclient.server.crossfire.DefaultCrossfireServerConnection.processUpdSpell().
|
private |
Spells currently exposed, based on the filter.
Definition at line 77 of file SpellsManager.java.
Referenced by com.realtime.crossfire.jxclient.spells.SpellsManager.filterSpells(), com.realtime.crossfire.jxclient.spells.SpellsManager.getAllSpells(), com.realtime.crossfire.jxclient.spells.SpellsManager.getFilteredSpell(), com.realtime.crossfire.jxclient.spells.SpellsManager.getFilteredSpells(), com.realtime.crossfire.jxclient.spells.SpellsManager.getFilteredSpellsCount(), and com.realtime.crossfire.jxclient.spells.SpellsManager.selectCharacter().
|
private |
The GuiStateListener for detecting established or dropped connections.
Definition at line 112 of file SpellsManager.java.
Referenced by com.realtime.crossfire.jxclient.spells.SpellsManager.SpellsManager().
|
private |
The SpellsManagerListeners to notify about changes.
Definition at line 97 of file SpellsManager.java.
Referenced by com.realtime.crossfire.jxclient.spells.SpellsManager.addCrossfireSpellChangedListener(), com.realtime.crossfire.jxclient.spells.SpellsManager.addSpell(), com.realtime.crossfire.jxclient.spells.SpellsManager.deleteSpellByIndex(), com.realtime.crossfire.jxclient.spells.SpellsManager.filterSkill(), and com.realtime.crossfire.jxclient.spells.SpellsManager.removeCrossfireSpellChangedListener().
|
private |
Dummy skill for "all skills".
Definition at line 166 of file SpellsManager.java.
Referenced by com.realtime.crossfire.jxclient.spells.SpellsManager.rebuildSkills().
|
private |
Skill to filter spells by, as a skill id in SkillSet. -1 means to not filter.
Definition at line 83 of file SpellsManager.java.
Referenced by com.realtime.crossfire.jxclient.spells.SpellsManager.filterSkill(), and com.realtime.crossfire.jxclient.spells.SpellsManager.filterSpells().
|
private |
The SkillSet containing skills from the server.
Definition at line 156 of file SpellsManager.java.
Referenced by com.realtime.crossfire.jxclient.spells.SpellsManager.addSpell(), com.realtime.crossfire.jxclient.spells.SpellsManager.filterSkill(), com.realtime.crossfire.jxclient.spells.SpellsManager.rebuildSkills(), and com.realtime.crossfire.jxclient.spells.SpellsManager.SpellsManager().
|
private |
A Comparator to compare Spell instances by spell path and name.
Definition at line 104 of file SpellsManager.java.
Referenced by com.realtime.crossfire.jxclient.spells.SpellsManager.addSpell().
|
private |
All known spells.
Definition at line 71 of file SpellsManager.java.
Referenced by com.realtime.crossfire.jxclient.spells.SpellsManager.addSpell(), com.realtime.crossfire.jxclient.spells.SpellsManager.deleteSpell(), com.realtime.crossfire.jxclient.spells.SpellsManager.deleteSpellByIndex(), com.realtime.crossfire.jxclient.spells.SpellsManager.displaysFace(), com.realtime.crossfire.jxclient.spells.SpellsManager.filterSpells(), com.realtime.crossfire.jxclient.spells.SpellsManager.getSpell(), com.realtime.crossfire.jxclient.spells.SpellsManager.rebuildSkills(), com.realtime.crossfire.jxclient.spells.SpellsManager.selectCharacter(), and com.realtime.crossfire.jxclient.spells.SpellsManager.updateSpell().
|
private |
Skills used by the spell, including the "all" skill.
Definition at line 171 of file SpellsManager.java.
Referenced by com.realtime.crossfire.jxclient.spells.SpellsManager.filterSkill(), com.realtime.crossfire.jxclient.spells.SpellsManager.getSpellSkill(), com.realtime.crossfire.jxclient.spells.SpellsManager.getSpellSkills(), and com.realtime.crossfire.jxclient.spells.SpellsManager.rebuildSkills().
|
private |
The Stats for the player.
Definition at line 161 of file SpellsManager.java.
Referenced by com.realtime.crossfire.jxclient.spells.SpellsManager.addSpell(), and com.realtime.crossfire.jxclient.spells.SpellsManager.SpellsManager().
|
private |
All unknown spells that have been referenced before. Maps spell name to Spell instance. Accesses are synchronized on this instance.
Definition at line 90 of file SpellsManager.java.
Referenced by com.realtime.crossfire.jxclient.spells.SpellsManager.addSpell(), and com.realtime.crossfire.jxclient.spells.SpellsManager.deleteSpellByIndex().
|
static |
Flag for updspell command: damage is present.
Definition at line 65 of file SpellsManager.java.
Referenced by com.realtime.crossfire.jxclient.server.crossfire.DefaultCrossfireServerConnection.processUpdSpell(), and com.realtime.crossfire.jxclient.spells.SpellsManager.updateSpell().
|
static |
Flag for updspell command: grace is present.
Definition at line 60 of file SpellsManager.java.
Referenced by com.realtime.crossfire.jxclient.server.crossfire.DefaultCrossfireServerConnection.processUpdSpell(), and com.realtime.crossfire.jxclient.spells.SpellsManager.updateSpell().
|
static |
Flag for updspell command: mana is present.
Definition at line 55 of file SpellsManager.java.
Referenced by com.realtime.crossfire.jxclient.server.crossfire.DefaultCrossfireServerConnection.processUpdSpell(), and com.realtime.crossfire.jxclient.spells.SpellsManager.updateSpell().