PlayerLevel

public final classPlayerLevelextendsObject
implementsParcelable

Data object representing a level a player can obtain in the metagame.

APlayerLevelhas three components: a numeric value, and a range of XP totals it represents. A player is considered a given level if they haveat least getMinXp()andless thangetMaxXp().

Inherited Constant Summary

Field Summary

public static finalCreator<PlayerLevel> CREATOR

Public Method Summary

boolean
int
getLevelNumber()
Returns the number for this level, e.g.
long
getMaxXp()
Returns the maximum XP value represented by this level, exclusive.
long
getMinXp()
Returns the minimum XP value needed to attain this level, inclusive.
int
String
void
writeToParcel(Parcelout, int flags)

Inherited Method Summary

Fields

public static finalCreator<PlayerLevel> CREATOR

Public Methods

public booleanequals(Objectobj)

public intgetLevelNumber()

Returns the number for this level, e.g. "level 10".

This is the level that this object represents. For a player to be considered as being of this level, the value given by PlayerLevelInfo.getCurrentXpTotal()must fall in the range [getMinXp(), getMaxXp()).

Returns
  • The level number for this level.

public longgetMaxXp()

Returns the maximum XP value represented by this level, exclusive.

public longgetMinXp()

Returns the minimum XP value needed to attain this level, inclusive.

public inthashCode()

publicStringtoString()

public voidwriteToParcel(Parcelout, int flags)