Crossfire JXClient, Trunk  R20561
com.realtime.crossfire.jxclient.stats.ActiveSkillWatcher Class Reference

Helper class to synthesize an "active skill" stat value. More...

+ Collaboration diagram for com.realtime.crossfire.jxclient.stats.ActiveSkillWatcher:

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...
 

Detailed Description

Helper class to synthesize an "active skill" stat value.

The Crossfire server currently does not send this information, therefore range stat messages are tracked.

Author
Andreas Kirschbaum

Definition at line 35 of file ActiveSkillWatcher.java.

Constructor & Destructor Documentation

◆ ActiveSkillWatcher()

com.realtime.crossfire.jxclient.stats.ActiveSkillWatcher.ActiveSkillWatcher ( @NotNull final Stats  stats,
@NotNull final CrossfireServerConnection  crossfireServerConnection 
)

Member Function Documentation

◆ checkMessage()

void com.realtime.crossfire.jxclient.stats.ActiveSkillWatcher.checkMessage ( @NotNull final String  message)
private

Checks whether a drawinfo message is skill related.

Parameters
messagethe 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().

+ Here is the call graph for this function:

◆ checkRange()

void com.realtime.crossfire.jxclient.stats.ActiveSkillWatcher.checkRange ( @NotNull final String  range)
private

Checks whether the range attribute has changed.

Parameters
rangethe new range attribute

Definition at line 153 of file ActiveSkillWatcher.java.

References com.realtime.crossfire.jxclient.stats.ActiveSkillWatcher.setActive().

+ Here is the call graph for this function:

◆ setActive()

void com.realtime.crossfire.jxclient.stats.ActiveSkillWatcher.setActive ( @NotNull final String  activeSkill)
private

Member Data Documentation

◆ activeSkill

String com.realtime.crossfire.jxclient.stats.ActiveSkillWatcher.activeSkill = ""
private

The last known active skill name.

Definition at line 59 of file ActiveSkillWatcher.java.

Referenced by com.realtime.crossfire.jxclient.stats.ActiveSkillWatcher.setActive().

◆ drawextinfoListener

final CrossfireDrawextinfoListener com.realtime.crossfire.jxclient.stats.ActiveSkillWatcher.drawextinfoListener
private
Initial value:
= new CrossfireDrawextinfoListener() {
@Override
public void commandDrawextinfoReceived(final int color, final int type, final int subtype, @NotNull final String message) {
checkMessage(message);
}
@Override
public void setDebugMode(final boolean printMessageTypes) {
}
}

The drawextinfo listener to receive drawextinfo messages.

Definition at line 122 of file ActiveSkillWatcher.java.

Referenced by com.realtime.crossfire.jxclient.stats.ActiveSkillWatcher.ActiveSkillWatcher().

◆ drawinfoListener

final CrossfireDrawinfoListener com.realtime.crossfire.jxclient.stats.ActiveSkillWatcher.drawinfoListener = (text, type) -> checkMessage(text)
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().

◆ READIED_SKILLS

final String com.realtime.crossfire.jxclient.stats.ActiveSkillWatcher.READIED_SKILLS = "Readied skill: "
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().

◆ stats

final Stats com.realtime.crossfire.jxclient.stats.ActiveSkillWatcher.stats
private

◆ statsListener

final StatsListener com.realtime.crossfire.jxclient.stats.ActiveSkillWatcher.statsListener
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().

◆ sync

final Object com.realtime.crossfire.jxclient.stats.ActiveSkillWatcher.sync = new Object()
private

The object used for synchronization.

Definition at line 47 of file ActiveSkillWatcher.java.

Referenced by com.realtime.crossfire.jxclient.stats.ActiveSkillWatcher.setActive().


The documentation for this class was generated from the following file: