Interface GameStatsHolder


public interface GameStatsHolder
  • Method Details

    • getArena

      IArena getArena()
    • register

      void register(@NotNull @NotNull GameStatisticProvider<?> statistic)
      Register statistic. Throws a runtime exception if statistic is already registered.
      Parameters:
      statistic - new statistic.
    • init

      PlayerGameStats init(org.bukkit.entity.Player player)
      Initialize game session stats for given player.
      Parameters:
      player - stats holder.
    • unregisterPlayer

      void unregisterPlayer(UUID uuid)
      Remove player tracked data.
      Parameters:
      uuid - holder.
    • getCreate

      @NotNull @NotNull PlayerGameStats getCreate(@NotNull @NotNull org.bukkit.entity.Player holder)
      Get existing or initialize statistic for given player.
      Parameters:
      holder - player holder.
      Returns:
      Existing or new statistic.
    • get

      Optional<PlayerGameStats> get(@NotNull @NotNull UUID holder)
      Get existing or initialize statistic for given player.
      Parameters:
      holder - player holder.
      Returns:
      Existing or new statistic.
    • get

      default Optional<PlayerGameStats> get(@NotNull @NotNull org.bukkit.entity.Player holder)
      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

      List<Optional<PlayerGameStats>> getOrderedBy(@NotNull @NotNull String statistic)
      Parameters:
      statistic - Order collection by given statistic.
      Returns:
      top list.
    • hasStatistic

      boolean hasStatistic(String orderBy)
      Check if given statistic is registered.
    • getRegistered

      List<String> getRegistered()
      Returns:
      unmodifiable list of registered game statistics.
    • getProvider

      @Nullable @Nullable GameStatisticProvider<?> getProvider(String registered)
      Get statistic provider.