Crossfire JXClient, Trunk
|
Public Member Functions | |
SoundStatsWatcher (@NotNull final Stats stats, @NotNull final JXCWindowRenderer windowRenderer, @NotNull final CrossfireServerConnection server, @NotNull final SoundManager soundManager) | |
Private Member Functions | |
void | checkStats (final int statNo, final int value) |
void | playClip (@NotNull final CharSequence clip) |
Private Attributes | |
boolean | active |
final CrossfireUpdateItemListener | crossfireUpdateItemListener |
long | ignoreLevelChange = System.currentTimeMillis()+DELAY |
int | level |
boolean | poisoned |
final RendererGuiStateListener | rendererGuiStateListener |
final SoundManager | soundManager |
final StatsListener | statsListener |
Static Private Attributes | |
static final long | DELAY = 5000 |
Monitors stat changes and generates appropriate sound effects.
Definition at line 38 of file SoundStatsWatcher.java.
com.realtime.crossfire.jxclient.sound.SoundStatsWatcher.SoundStatsWatcher | ( | @NotNull final Stats | stats, |
@NotNull final JXCWindowRenderer | windowRenderer, | ||
@NotNull final CrossfireServerConnection | server, | ||
@NotNull final SoundManager | soundManager | ||
) |
Creates a new instance.
stats | the stats instance to watch |
windowRenderer | the window renderer instance |
server | the crossfire server connection to watch |
soundManager | the sound manager instance to watch |
Definition at line 183 of file SoundStatsWatcher.java.
References com.realtime.crossfire.jxclient.stats.Stats.C_STAT_POISONED, com.realtime.crossfire.jxclient.sound.SoundStatsWatcher.crossfireUpdateItemListener, com.realtime.crossfire.jxclient.stats.Stats.CS_STAT_LEVEL, com.realtime.crossfire.jxclient.gui.gui.RendererGuiStateListener.guiStateChanged(), com.realtime.crossfire.jxclient.sound.SoundStatsWatcher.level, com.realtime.crossfire.jxclient.sound.SoundStatsWatcher.poisoned, com.realtime.crossfire.jxclient.sound.SoundStatsWatcher.rendererGuiStateListener, com.realtime.crossfire.jxclient.sound.SoundStatsWatcher.soundManager, and com.realtime.crossfire.jxclient.sound.SoundStatsWatcher.statsListener.
|
private |
Checks for changed stats and generate sound effects.
statNo | the changed stat number |
value | the new stat value |
Definition at line 198 of file SoundStatsWatcher.java.
References com.realtime.crossfire.jxclient.sound.SoundStatsWatcher.active, com.realtime.crossfire.jxclient.stats.Stats.C_STAT_POISONED, com.realtime.crossfire.jxclient.stats.Stats.CS_STAT_LEVEL, com.realtime.crossfire.jxclient.sound.SoundStatsWatcher.ignoreLevelChange, com.realtime.crossfire.jxclient.sound.SoundStatsWatcher.level, com.realtime.crossfire.jxclient.sound.Sounds.LEVEL_UP, com.realtime.crossfire.jxclient.sound.SoundStatsWatcher.playClip(), com.realtime.crossfire.jxclient.sound.Sounds.POISON_OFF, com.realtime.crossfire.jxclient.sound.Sounds.POISON_ON, and com.realtime.crossfire.jxclient.sound.SoundStatsWatcher.poisoned.
|
private |
Plays a clip if sounds should be generated.
clip | the sound clip to play |
Definition at line 224 of file SoundStatsWatcher.java.
References com.realtime.crossfire.jxclient.sound.SoundStatsWatcher.active, com.realtime.crossfire.jxclient.sound.Sounds.CHARACTER, com.realtime.crossfire.jxclient.sound.SoundManager.playClip(), and com.realtime.crossfire.jxclient.sound.SoundStatsWatcher.soundManager.
Referenced by com.realtime.crossfire.jxclient.sound.SoundStatsWatcher.checkStats().
|
private |
Whether sounds should be generated.
Definition at line 54 of file SoundStatsWatcher.java.
Referenced by com.realtime.crossfire.jxclient.sound.SoundStatsWatcher.checkStats(), and com.realtime.crossfire.jxclient.sound.SoundStatsWatcher.playClip().
|
private |
The CrossfireUpdateItemListener to receive item updates.
Definition at line 147 of file SoundStatsWatcher.java.
Referenced by com.realtime.crossfire.jxclient.sound.SoundStatsWatcher.SoundStatsWatcher().
|
staticprivate |
Duration for which to ignore level changes after login.
Definition at line 43 of file SoundStatsWatcher.java.
|
private |
Ignore level changes until this time has reached. This is used to suppress false positives right after login. The value
means not to ignore level changes.
Definition at line 71 of file SoundStatsWatcher.java.
Referenced by com.realtime.crossfire.jxclient.sound.SoundStatsWatcher.checkStats().
|
private |
The last known level.
Definition at line 64 of file SoundStatsWatcher.java.
Referenced by com.realtime.crossfire.jxclient.sound.SoundStatsWatcher.checkStats(), and com.realtime.crossfire.jxclient.sound.SoundStatsWatcher.SoundStatsWatcher().
|
private |
The last known poisoned state.
Definition at line 59 of file SoundStatsWatcher.java.
Referenced by com.realtime.crossfire.jxclient.sound.SoundStatsWatcher.checkStats(), and com.realtime.crossfire.jxclient.sound.SoundStatsWatcher.SoundStatsWatcher().
|
private |
The gui state listener.
Definition at line 137 of file SoundStatsWatcher.java.
Referenced by com.realtime.crossfire.jxclient.sound.SoundStatsWatcher.SoundStatsWatcher().
|
private |
The SoundManager instance to watch.
Definition at line 49 of file SoundStatsWatcher.java.
Referenced by com.realtime.crossfire.jxclient.sound.SoundStatsWatcher.playClip(), and com.realtime.crossfire.jxclient.sound.SoundStatsWatcher.SoundStatsWatcher().
|
private |
The crossfire stats listener.
Definition at line 78 of file SoundStatsWatcher.java.
Referenced by com.realtime.crossfire.jxclient.sound.SoundStatsWatcher.SoundStatsWatcher().