com.realtime.crossfire.jxclient.stats
Class ActiveSkillWatcher

java.lang.Object
  extended by com.realtime.crossfire.jxclient.stats.ActiveSkillWatcher

public class ActiveSkillWatcher
extends java.lang.Object

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

activeSkill

@NotNull
private java.lang.String activeSkill
The last known active skill name.


drawextinfoListener

@NotNull
private final CrossfireDrawextinfoListener drawextinfoListener
The drawextinfo listener to receive drawextinfo messages.


drawinfoListener

@NotNull
private final CrossfireDrawinfoListener drawinfoListener
The drawinfo listener to receive drawinfo messages.


READIED_SKILLS

@NotNull
private static final java.lang.String READIED_SKILLS
Prefix string when searching for the currently active skill.

See Also:
Constant Field Values

stats

@NotNull
private final Stats stats
The stats instance to notify.


statsListener

@NotNull
private final StatsListener statsListener
The stats listener to detect the range stat.


sync

@NotNull
private final java.lang.Object sync
The object used for synchronization.

Constructor Detail

ActiveSkillWatcher

public ActiveSkillWatcher(@NotNull
                          Stats stats,
                          @NotNull
                          CrossfireServerConnection crossfireServerConnection)
Create a new instance.

Parameters:
stats - The stats instance to notify/watch.
crossfireServerConnection - The connection to watch.
Method Detail

checkMessage

private void checkMessage(@NotNull
                          java.lang.String message)
Check whether a drawinfo message is skill related.

Parameters:
message - the message

checkRange

private void checkRange(@NotNull
                        java.lang.String range)
Check whether the range attribute has changed.

Parameters:
range - the new range attribute

setActive

private void setActive(@NotNull
                       java.lang.String activeSkill)
Set the active skill name.

Parameters:
activeSkill - The active skill name.