java.lang.Object com.realtime.crossfire.jxclient.sound.StatsWatcher
public class StatsWatcher
Monitors stat changes and generates appropriate sound effects.
Field Summary | |
---|---|
private boolean |
active
Whether sounds should be generated. |
private CrossfireUpdateItemListener |
crossfireUpdateItemListener
The CrossfireUpdateItemListener to receive item updates. |
private static long |
DELAY
Duration for which to ignore level changes after login. |
private long |
ignoreLevelChange
Ignore level changes until this time has reached. |
private int |
level
The last know level. |
private boolean |
poisoned
The last known poisoned state. |
private RendererGuiStateListener |
rendererGuiStateListener
The gui state listener. |
private SoundManager |
soundManager
The SoundManager instance to watch. |
private StatsListener |
statsListener
The crossfire stats listener. |
Constructor Summary | |
---|---|
StatsWatcher(Stats stats,
JXCWindowRenderer windowRenderer,
CrossfireServerConnection server,
SoundManager soundManager)
Creates a new instance. |
Method Summary | |
---|---|
private void |
checkStats(int statNo,
int value)
Checks for changed stats and generate sound effects. |
private void |
playClip(java.lang.String clip)
Plays a clip if sounds should be generated. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private boolean active
@NotNull private final CrossfireUpdateItemListener crossfireUpdateItemListener
CrossfireUpdateItemListener
to receive item updates.
private static final long DELAY
private long ignoreLevelChange
0
means not to ignore level changes.
private int level
private boolean poisoned
@NotNull private final RendererGuiStateListener rendererGuiStateListener
@NotNull private final SoundManager soundManager
SoundManager
instance to watch.
@NotNull private final StatsListener statsListener
Constructor Detail |
---|
public StatsWatcher(@NotNull Stats stats, @NotNull JXCWindowRenderer windowRenderer, @NotNull CrossfireServerConnection server, @NotNull SoundManager soundManager)
stats
- the stats instance to watchwindowRenderer
- the window renderer instanceserver
- the crossfire server connection to watchsoundManager
- the sound manager instance to watchMethod Detail |
---|
private void checkStats(int statNo, int value)
statNo
- the changed stat numbervalue
- the new stat valueprivate void playClip(@NotNull java.lang.String clip)
clip
- the sound clip to play