Interface GameStatsHolder
public interface GameStatsHolder
-
Method Summary
Modifier and TypeMethodDescriptionGet existing or initialize statistic for given player.default Optional<PlayerGameStats>
get
(@NotNull org.bukkit.entity.Player holder) Get existing or initialize statistic for given player.getArena()
@NotNull PlayerGameStats
getCreate
(@NotNull org.bukkit.entity.Player holder) Get existing or initialize statistic for given player.default Collection<Optional<PlayerGameStats>>
getOrderedBy
(@NotNull DefaultStatistics statistic) getOrderedBy
(@NotNull String statistic) @Nullable GameStatisticProvider<?>
getProvider
(String registered) Get statistic provider.Get tracked players.boolean
hasStatistic
(String orderBy) Check if given statistic is registered.init
(org.bukkit.entity.Player player) Initialize game session stats for given player.void
register
(@NotNull GameStatisticProvider<?> statistic) Register statistic.void
unregisterPlayer
(UUID uuid) Remove player tracked data.
-
Method Details
-
getArena
IArena getArena() -
register
Register statistic. Throws a runtime exception if statistic is already registered.- Parameters:
statistic
- new statistic.
-
init
Initialize game session stats for given player.- Parameters:
player
- stats holder.
-
unregisterPlayer
Remove player tracked data.- Parameters:
uuid
- holder.
-
getCreate
Get existing or initialize statistic for given player.- Parameters:
holder
- player holder.- Returns:
- Existing or new statistic.
-
get
Get existing or initialize statistic for given player.- Parameters:
holder
- player holder.- Returns:
- Existing or new statistic.
-
get
Get existing or initialize statistic for given player.- Parameters:
holder
- player holder.- Returns:
- Existing or new statistic.
-
getTrackedPlayers
Collection<Optional<PlayerGameStats>> getTrackedPlayers()Get tracked players.- Returns:
- Unmodifiable list of tracked players.
-
getOrderedBy
default Collection<Optional<PlayerGameStats>> getOrderedBy(@NotNull @NotNull DefaultStatistics statistic) - Parameters:
statistic
- Order collection by given statistic.- Returns:
- top list.
-
getOrderedBy
- Parameters:
statistic
- Order collection by given statistic.- Returns:
- top list.
-
hasStatistic
Check if given statistic is registered. -
getRegistered
- Returns:
- unmodifiable list of registered game statistics.
-
getProvider
Get statistic provider.
-