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

Helper class to generate Stats#C_STAT_STARVING value from the Stats#CS_STAT_FOOD value. More...

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

Public Member Functions

 StarvingWatcher (@NotNull final Stats stats)
 Creates a new instance. More...
 

Private Member Functions

void update ()
 Updates the current starving state from the current food value. More...
 

Private Attributes

final Stats stats
 The stats instance to notify. More...
 
final StatsListener statsListener
 The StatsListener registered to be notified about stat changes. More...
 
final Timer timer = new Timer(TIMEOUT_DE_ASSERT, e -> update())
 The Timer for turning off the poison symbol. More...
 

Static Private Attributes

static final int TIMEOUT_DE_ASSERT = 1000
 Timeout after that the "starving" state is set or reset. More...
 

Detailed Description

Helper class to generate Stats#C_STAT_STARVING value from the Stats#CS_STAT_FOOD value.

Author
Andreas Kirschbaum

Definition at line 33 of file StarvingWatcher.java.

Constructor & Destructor Documentation

◆ StarvingWatcher()

com.realtime.crossfire.jxclient.stats.StarvingWatcher.StarvingWatcher ( @NotNull final Stats  stats)

Member Function Documentation

◆ update()

void com.realtime.crossfire.jxclient.stats.StarvingWatcher.update ( )
private

Member Data Documentation

◆ stats

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

◆ statsListener

final StatsListener com.realtime.crossfire.jxclient.stats.StarvingWatcher.statsListener
private

The StatsListener registered to be notified about stat changes.

Definition at line 51 of file StarvingWatcher.java.

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

◆ TIMEOUT_DE_ASSERT

final int com.realtime.crossfire.jxclient.stats.StarvingWatcher.TIMEOUT_DE_ASSERT = 1000
staticprivate

Timeout after that the "starving" state is set or reset.

Definition at line 38 of file StarvingWatcher.java.

◆ timer

final Timer com.realtime.crossfire.jxclient.stats.StarvingWatcher.timer = new Timer(TIMEOUT_DE_ASSERT, e -> update())
private

The Timer for turning off the poison symbol.

Definition at line 103 of file StarvingWatcher.java.

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


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