java.lang.Objectcom.realtime.crossfire.jxclient.stats.ActiveSkillWatcher
public class ActiveSkillWatcher
Helper class to synthesize an "active skill" stat value. The Crossfire server currently does not send this information, therefore range stat messages are tracked.
| Field Summary | |
|---|---|
private  java.lang.String | 
activeSkill
The last known active skill name.  | 
private  CrossfireDrawextinfoListener | 
drawextinfoListener
The drawextinfo listener to receive drawextinfo messages.  | 
private  CrossfireDrawinfoListener | 
drawinfoListener
The drawinfo listener to receive drawinfo messages.  | 
private static java.lang.String | 
READIED_SKILLS
Prefix string when searching for the currently active skill.  | 
private  Stats | 
stats
The stats instance to notify.  | 
private  StatsListener | 
statsListener
The stats listener to detect the range stat.  | 
private  java.lang.Object | 
sync
The object used for synchronization.  | 
| Constructor Summary | |
|---|---|
ActiveSkillWatcher(Stats stats,
                   CrossfireServerConnection crossfireServerConnection)
Create a new instance.  | 
|
| Method Summary | |
|---|---|
private  void | 
checkMessage(java.lang.String message)
Check whether a drawinfo message is skill related.  | 
private  void | 
checkRange(java.lang.String range)
Check whether the range attribute has changed.  | 
private  void | 
setActive(java.lang.String activeSkill)
Set the active skill name.  | 
| Methods inherited from class java.lang.Object | 
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
@NotNull private java.lang.String activeSkill
@NotNull private final CrossfireDrawextinfoListener drawextinfoListener
@NotNull private final CrossfireDrawinfoListener drawinfoListener
@NotNull private static final java.lang.String READIED_SKILLS
@NotNull private final Stats stats
@NotNull private final StatsListener statsListener
@NotNull private final java.lang.Object sync
| Constructor Detail | 
|---|
public ActiveSkillWatcher(@NotNull
                          Stats stats,
                          @NotNull
                          CrossfireServerConnection crossfireServerConnection)
stats - The stats instance to notify/watch.crossfireServerConnection - The connection to watch.| Method Detail | 
|---|
private void checkMessage(@NotNull
                          java.lang.String message)
message - the message
private void checkRange(@NotNull
                        java.lang.String range)
range - the new range attribute
private void setActive(@NotNull
                       java.lang.String activeSkill)
activeSkill - The active skill name.