Package de.marcely.bedwars.api.player
Class LeaderboardFetchResult
java.lang.Object
de.marcely.bedwars.api.player.LeaderboardFetchResult
Result object of
PlayerDataAPI.fetchLeaderboard(PlayerStatSet, int, int, Consumer)-
Constructor Summary
ConstructorsConstructorDescriptionLeaderboardFetchResult(PlayerStatSet statSet, int minRank, int maxRank, PlayerStats[] stats, PlayerProperties[] properties) -
Method Summary
Modifier and TypeMethodDescriptionintGets the maximum rank that has been fetched with this result.intGets the minimum rank that has been fetched with this result.@Nullable PlayerPropertiesgetPropertiesAtRank(int rank) Obtains the properties of the player at the given rank.@Nullable PlayerStatsgetStatsAtRank(int rank) Obtains the stats of the player at the given rank.Get the stat set that was used to order the players.
-
Constructor Details
-
LeaderboardFetchResult
public LeaderboardFetchResult(PlayerStatSet statSet, int minRank, int maxRank, PlayerStats[] stats, PlayerProperties[] properties)
-
-
Method Details
-
getStatSet
Get the stat set that was used to order the players.- Returns:
- The stat set with which the players were ordered
-
getMinRank
public int getMinRank()Gets the minimum rank that has been fetched with this result.Starts at 1 (= best player).
- Returns:
- The minimum rank that can be obtained
-
getMaxRank
public int getMaxRank()Gets the maximum rank that has been fetched with this result.- Returns:
- The maximum rank that can be obtained
-
getStatsAtRank
Obtains the stats of the player at the given rank.May be
nullif no player has reached the given rank yet.- Parameters:
rank- The rank we want to check- Returns:
- The stats of the player that is at the given rank. May be
null - Throws:
IllegalArgumentException- In case the rank parameter is out of bounds (must be between min and max)
-
getPropertiesAtRank
Obtains the properties of the player at the given rank.May be
nullif no player has reached the given rank yet.- Parameters:
rank- The rank we want to check- Returns:
- The properties of the player that is at the given rank. May be
null - Throws:
IllegalArgumentException- In case the rank parameter is out of bounds (must be between min and max)
-