ExperienceUtils
in package
Table of Contents
- getLevelFromXp() : float
- Calculates and returns the number of XP levels the specified amount of XP points are worth.
- getXpToCompleteLevel() : int
- Returns the amount of XP needed to reach $level + 1.
- getXpToReachLevel() : int
- Calculates and returns the amount of XP needed to get from level 0 to level $level
Methods
getLevelFromXp()
Calculates and returns the number of XP levels the specified amount of XP points are worth.
public
static getLevelFromXp(int $xp) : float
This returns a floating-point number, the decimal part being the progress through the resulting level.
Parameters
- $xp : int
Return values
float —getXpToCompleteLevel()
Returns the amount of XP needed to reach $level + 1.
public
static getXpToCompleteLevel(int $level) : int
Parameters
- $level : int
Return values
int —getXpToReachLevel()
Calculates and returns the amount of XP needed to get from level 0 to level $level
public
static getXpToReachLevel(int $level) : int
Parameters
- $level : int