Crossfire JXClient, Trunk
com.realtime.crossfire.jxclient.gui.gauge.StatGaugeUpdater Class Reference

A GaugeUpdater which monitors a stat value. More...

+ Inheritance diagram for com.realtime.crossfire.jxclient.gui.gauge.StatGaugeUpdater:
+ Collaboration diagram for com.realtime.crossfire.jxclient.gui.gauge.StatGaugeUpdater:

Public Member Functions

void dispose ()
 Frees allocated resources. More...
 
 StatGaugeUpdater (@NotNull final ExperienceTable experienceTable, final int stat, @NotNull final Stats stats, @NotNull final ItemSet itemSet)
 Creates a new instance. More...
 
- Public Member Functions inherited from com.realtime.crossfire.jxclient.gui.gauge.GaugeUpdater
void setGauge (@NotNull final GUIGaugeListener gauge)
 Sets the gauge to update. More...
 

Private Member Functions

void updateExperienceNextLevel ()
 Updates information for Stats#C_STAT_EXP_NEXT_LEVEL. More...
 

Private Attributes

boolean active
 Whether the low food event should be generated. More...
 
final ItemSet itemSet
 The ItemSet instance to watch. More...
 
final ItemSetListener itemSetListener
 The listener to detect a changed player name. More...
 
final int stat
 The stat value to monitor. More...
 
final Stats stats
 The Stats instance to watch. More...
 
final StatsListener statsListener
 The StatsListener registered to be notified about stat changes. More...
 

Static Private Attributes

static final int LOWFOOD_LIMIT = 100
 The LOWFOOD indicator is turned on if the FOOD value falls below this value. More...
 

Additional Inherited Members

- Protected Member Functions inherited from com.realtime.crossfire.jxclient.gui.gauge.GaugeUpdater
 GaugeUpdater (@NotNull final ExperienceTable experienceTable, final boolean hideIfEmpty)
 Creates a new instance. More...
 
long getExperienceToNextLevel (final int level, final long experience)
 Returns the experience needed to reach next level. More...
 
int getPercentsToNextLevel (final int level, final long experience)
 Returns the experience fraction of the current level. More...
 
void setValues (final int curValue, final int minValue, final int maxValue)
 Updates the gauge values. More...
 
void setValues (final int curValue, final int minValue, final int maxValue, @NotNull final String labelText, @NotNull final String tooltipText)
 Updates the gauge values. More...
 

Detailed Description

A GaugeUpdater which monitors a stat value.

Author
Andreas Kirschbaum

Definition at line 39 of file StatGaugeUpdater.java.

Constructor & Destructor Documentation

◆ StatGaugeUpdater()

com.realtime.crossfire.jxclient.gui.gauge.StatGaugeUpdater.StatGaugeUpdater ( @NotNull final ExperienceTable  experienceTable,
final int  stat,
@NotNull final Stats  stats,
@NotNull final ItemSet  itemSet 
)

Member Function Documentation

◆ dispose()

◆ updateExperienceNextLevel()

Member Data Documentation

◆ active

boolean com.realtime.crossfire.jxclient.gui.gauge.StatGaugeUpdater.active
private

Whether the low food event should be generated.

Definition at line 67 of file StatGaugeUpdater.java.

◆ itemSet

final ItemSet com.realtime.crossfire.jxclient.gui.gauge.StatGaugeUpdater.itemSet
private

◆ itemSetListener

final ItemSetListener com.realtime.crossfire.jxclient.gui.gauge.StatGaugeUpdater.itemSetListener
private
Initial value:
= new ItemSetListener() {
@Override
public void playerChanged(@Nullable final CfItem player) {
active = player != null;
}
@Override
public void openContainerChanged(final int tag) {
}
}

The listener to detect a changed player name.

Definition at line 191 of file StatGaugeUpdater.java.

Referenced by com.realtime.crossfire.jxclient.gui.gauge.StatGaugeUpdater.dispose(), and com.realtime.crossfire.jxclient.gui.gauge.StatGaugeUpdater.StatGaugeUpdater().

◆ LOWFOOD_LIMIT

final int com.realtime.crossfire.jxclient.gui.gauge.StatGaugeUpdater.LOWFOOD_LIMIT = 100
staticprivate

The LOWFOOD indicator is turned on if the FOOD value falls below this value.

Definition at line 45 of file StatGaugeUpdater.java.

◆ stat

final int com.realtime.crossfire.jxclient.gui.gauge.StatGaugeUpdater.stat
private

The stat value to monitor.

Definition at line 50 of file StatGaugeUpdater.java.

Referenced by com.realtime.crossfire.jxclient.gui.gauge.StatGaugeUpdater.StatGaugeUpdater().

◆ stats

◆ statsListener

final StatsListener com.realtime.crossfire.jxclient.gui.gauge.StatGaugeUpdater.statsListener
private

The documentation for this class was generated from the following file:
com.realtime.crossfire.jxclient.gui.gauge.StatGaugeUpdater.active
boolean active
Whether the low food event should be generated.
Definition: StatGaugeUpdater.java:67