Crossfire JXClient, Trunk
Public Member Functions | Private Member Functions | Private Attributes | List of all members
com.realtime.crossfire.jxclient.stats.ExperienceTable Class Reference
Collaboration diagram for com.realtime.crossfire.jxclient.stats.ExperienceTable:
Collaboration graph

Public Member Functions

long getExperienceToNextLevel (final int currentLevel, final long currentExp)
 
int getPercentsToNextLevel (final int currentLevel, final long currentExp)
 
void setExpTable (final long @NotNull[] expTable)
 

Private Member Functions

void add (final int level, final long exp)
 
void clear ()
 
long getExperience (final int level)
 

Private Attributes

final Map< Integer, Long > info = new HashMap<>()
 
int maxLevel
 
int minLevel
 

Detailed Description

Stores experience <-> level mappings.

Author
Andreas Kirschbaum

Definition at line 33 of file ExperienceTable.java.

Member Function Documentation

◆ add()

void com.realtime.crossfire.jxclient.stats.ExperienceTable.add ( final int  level,
final long  exp 
)
private

Adds a new level->experience mapping.

Parameters
levelthe level to update
expthe experience needed to reach level
level

Definition at line 65 of file ExperienceTable.java.

References com.realtime.crossfire.jxclient.stats.ExperienceTable.info, com.realtime.crossfire.jxclient.stats.ExperienceTable.maxLevel, and com.realtime.crossfire.jxclient.stats.ExperienceTable.minLevel.

Referenced by com.realtime.crossfire.jxclient.stats.ExperienceTable.setExpTable().

Here is the caller graph for this function:

◆ clear()

void com.realtime.crossfire.jxclient.stats.ExperienceTable.clear ( )
private

◆ getExperience()

long com.realtime.crossfire.jxclient.stats.ExperienceTable.getExperience ( final int  level)
private

◆ getExperienceToNextLevel()

long com.realtime.crossfire.jxclient.stats.ExperienceTable.getExperienceToNextLevel ( final int  currentLevel,
final long  currentExp 
)

Returns the experience needed to reach the next level.

Parameters
currentLevelthe current level
currentExpthe current experience
Returns
the experience to reach level
currentLevel+1

Definition at line 118 of file ExperienceTable.java.

References com.realtime.crossfire.jxclient.stats.ExperienceTable.getExperience().

Referenced by com.realtime.crossfire.jxclient.stats.Stats.calculateExperienceToNextLevel(), and com.realtime.crossfire.jxclient.gui.gauge.GaugeUpdater.getExperienceToNextLevel().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getPercentsToNextLevel()

int com.realtime.crossfire.jxclient.stats.ExperienceTable.getPercentsToNextLevel ( final int  currentLevel,
final long  currentExp 
)

Returns the experience fraction of the current level in percents. The value starts at 0% when a new level has been gained; the next level is at 100%.

Parameters
currentLevelthe current level
currentExpthe current experience
Returns
the experience fraction

Definition at line 131 of file ExperienceTable.java.

References com.realtime.crossfire.jxclient.stats.ExperienceTable.getExperience().

Referenced by com.realtime.crossfire.jxclient.gui.gauge.GaugeUpdater.getPercentsToNextLevel().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setExpTable()

void com.realtime.crossfire.jxclient.stats.ExperienceTable.setExpTable ( final long @NotNull[]  expTable)

Updates the experience table information.

Parameters
expTablethe new experience table

Definition at line 152 of file ExperienceTable.java.

References com.realtime.crossfire.jxclient.stats.ExperienceTable.add(), and com.realtime.crossfire.jxclient.stats.ExperienceTable.clear().

Referenced by com.realtime.crossfire.jxclient.server.crossfire.DefaultCrossfireServerConnection.processExpTableReplyinfo().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ info

final Map<Integer, Long> com.realtime.crossfire.jxclient.stats.ExperienceTable.info = new HashMap<>()
private

◆ maxLevel

int com.realtime.crossfire.jxclient.stats.ExperienceTable.maxLevel
private

◆ minLevel

int com.realtime.crossfire.jxclient.stats.ExperienceTable.minLevel
private

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