PlayerLevel Stay organized with collections Save and categorize content based on your preferences.
Page Summary
PlayerLevel is a data object representing a player's level in a game's metagame.
A PlayerLevel is defined by a numeric value and a range of XP, specifically from a minimum XP (inclusive) up to a maximum XP (exclusive).
Players are considered to be a given level if their current XP falls within the level's defined XP range.
The class includes methods to retrieve the level number, the minimum XP for the level, and the maximum XP for the level.
Data object representing a level a player can obtain in the metagame.
APlayerLevel has three components: a numeric value, and a range of XP totals it represents. A player is considered a given level if they haveat leastgetMinXp() andless thangetMaxXp().
Inherited Constant Summary
| int | CONTENTS_FILE_DESCRIPTOR | |
| int | PARCELABLE_WRITE_RETURN_VALUE |
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 | hashCode() |
| String | toString() |
| void | writeToParcel(Parcel out, int flags) |
Inherited Method Summary
| abstract int | describeContents() |
| abstract void | writeToParcel(Parcel arg0, int arg1) |
Fields
public static finalCreator<PlayerLevel>CREATOR
Public Methods
public booleanequals(Object obj)
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(Parcel out, int flags)
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-09-10 UTC.