public abstract class GaugeUpdater
extends java.lang.Object
GUIGauge
.Modifier | Constructor and Description |
---|---|
protected |
GaugeUpdater(@NotNull ExperienceTable experienceTable,
boolean hideIfEmpty)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
abstract void |
dispose()
Frees allocated resources.
|
protected long |
getExperienceToNextLevel(int level,
long experience)
Returns the experience needed to reach next level.
|
protected int |
getPercentsToNextLevel(int level,
long experience)
Returns the experience fraction of the current level.
|
void |
setGauge(@NotNull GUIGaugeListener gauge)
Sets the gauge to update.
|
protected void |
setValues(int curValue,
int minValue,
int maxValue)
Updates the gauge values.
|
protected void |
setValues(int curValue,
int minValue,
int maxValue,
@NotNull java.lang.String labelText,
@NotNull java.lang.String tooltipText)
Updates the gauge values.
|
protected GaugeUpdater(@NotNull @NotNull ExperienceTable experienceTable, boolean hideIfEmpty)
experienceTable
- the experience table to queryhideIfEmpty
- if true the gauge will be hidden if all values are 0public abstract void dispose()
public void setGauge(@NotNull @NotNull GUIGaugeListener gauge)
gauge
- the gaugeprotected void setValues(int curValue, int minValue, int maxValue)
curValue
- the current valueminValue
- the minimum valuemaxValue
- the maximum valueprotected void setValues(int curValue, int minValue, int maxValue, @NotNull @NotNull java.lang.String labelText, @NotNull @NotNull java.lang.String tooltipText)
curValue
- the current valueminValue
- the minimum valuemaxValue
- the maximum valuelabelText
- the text to draw on the gaugetooltipText
- the tooltip suffixprotected int getPercentsToNextLevel(int level, long experience)
level
- the levelexperience
- the experienceprotected long getExperienceToNextLevel(int level, long experience)
level
- the levelexperience
- the experience