Crossfire JXClient, Trunk
R20561
|
Helper class to synthesize an "active skill" stat value. More...
Public Member Functions | |
ActiveSkillWatcher (@NotNull final Stats stats, @NotNull final CrossfireServerConnection crossfireServerConnection) | |
Creates a new instance. More... | |
Private Member Functions | |
void | checkMessage (@NotNull final String message) |
Checks whether a drawinfo message is skill related. More... | |
void | checkRange (@NotNull final String range) |
Checks whether the range attribute has changed. More... | |
void | setActive (@NotNull final String activeSkill) |
Sets the active skill name. More... | |
Private Attributes | |
String | activeSkill = "" |
The last known active skill name. More... | |
final CrossfireDrawextinfoListener | drawextinfoListener |
The drawextinfo listener to receive drawextinfo messages. More... | |
final CrossfireDrawinfoListener | drawinfoListener = (text, type) -> checkMessage(text) |
The drawinfo listener to receive drawinfo messages. More... | |
final Stats | stats |
The stats instance to notify. More... | |
final StatsListener | statsListener |
The stats listener to detect the range stat. More... | |
final Object | sync = new Object() |
The object used for synchronization. More... | |
Static Private Attributes | |
static final String | READIED_SKILLS = "Readied skill: " |
Prefix string when searching for the currently active skill. More... | |
Helper class to synthesize an "active skill" stat value.
The Crossfire server currently does not send this information, therefore range stat messages are tracked.
Definition at line 35 of file ActiveSkillWatcher.java.
com.realtime.crossfire.jxclient.stats.ActiveSkillWatcher.ActiveSkillWatcher | ( | @NotNull final Stats | stats, |
@NotNull final CrossfireServerConnection | crossfireServerConnection | ||
) |
Creates a new instance.
stats | the stats instance to notify/watch |
crossfireServerConnection | the connection to watch |
Definition at line 141 of file ActiveSkillWatcher.java.
References com.realtime.crossfire.jxclient.stats.Stats.addCrossfireStatsListener(), com.realtime.crossfire.jxclient.stats.ActiveSkillWatcher.drawextinfoListener, com.realtime.crossfire.jxclient.stats.ActiveSkillWatcher.drawinfoListener, com.realtime.crossfire.jxclient.stats.ActiveSkillWatcher.setActive(), com.realtime.crossfire.jxclient.stats.ActiveSkillWatcher.stats, and com.realtime.crossfire.jxclient.stats.ActiveSkillWatcher.statsListener.
|
private |
Checks whether a drawinfo message is skill related.
message | the message |
Definition at line 163 of file ActiveSkillWatcher.java.
References com.realtime.crossfire.jxclient.stats.ActiveSkillWatcher.READIED_SKILLS, and com.realtime.crossfire.jxclient.stats.ActiveSkillWatcher.setActive().
|
private |
Checks whether the range attribute has changed.
range | the new range attribute |
Definition at line 153 of file ActiveSkillWatcher.java.
References com.realtime.crossfire.jxclient.stats.ActiveSkillWatcher.setActive().
|
private |
Sets the active skill name.
activeSkill | the active skill name |
Definition at line 175 of file ActiveSkillWatcher.java.
References com.realtime.crossfire.jxclient.stats.ActiveSkillWatcher.activeSkill, com.realtime.crossfire.jxclient.stats.Stats.setActiveSkill(), com.realtime.crossfire.jxclient.stats.ActiveSkillWatcher.stats, and com.realtime.crossfire.jxclient.stats.ActiveSkillWatcher.sync.
Referenced by com.realtime.crossfire.jxclient.stats.ActiveSkillWatcher.ActiveSkillWatcher(), com.realtime.crossfire.jxclient.stats.ActiveSkillWatcher.checkMessage(), and com.realtime.crossfire.jxclient.stats.ActiveSkillWatcher.checkRange().
|
private |
The last known active skill name.
Definition at line 59 of file ActiveSkillWatcher.java.
Referenced by com.realtime.crossfire.jxclient.stats.ActiveSkillWatcher.setActive().
|
private |
The drawextinfo listener to receive drawextinfo messages.
Definition at line 122 of file ActiveSkillWatcher.java.
Referenced by com.realtime.crossfire.jxclient.stats.ActiveSkillWatcher.ActiveSkillWatcher().
|
private |
The drawinfo listener to receive drawinfo messages.
Definition at line 115 of file ActiveSkillWatcher.java.
Referenced by com.realtime.crossfire.jxclient.stats.ActiveSkillWatcher.ActiveSkillWatcher().
|
staticprivate |
Prefix string when searching for the currently active skill.
Definition at line 41 of file ActiveSkillWatcher.java.
Referenced by com.realtime.crossfire.jxclient.stats.ActiveSkillWatcher.checkMessage().
|
private |
The stats instance to notify.
Definition at line 53 of file ActiveSkillWatcher.java.
Referenced by com.realtime.crossfire.jxclient.stats.ActiveSkillWatcher.ActiveSkillWatcher(), and com.realtime.crossfire.jxclient.stats.ActiveSkillWatcher.setActive().
|
private |
The stats listener to detect the range stat.
Definition at line 66 of file ActiveSkillWatcher.java.
Referenced by com.realtime.crossfire.jxclient.stats.ActiveSkillWatcher.ActiveSkillWatcher().
|
private |
The object used for synchronization.
Definition at line 47 of file ActiveSkillWatcher.java.
Referenced by com.realtime.crossfire.jxclient.stats.ActiveSkillWatcher.setActive().