Interface PlayerRepository

All Known Implementing Classes:
SQLPlayerRepository

public interface PlayerRepository
Repository interface for managing player data storage and retrieval.
  • Method Summary

    Modifier and Type
    Method
    Description
    getTopBalances(int topN)
    Gets the top N players with the highest balances.
    @Nullable PlayerData
    load(String uuid)
    Loads the player data from the storage system.
    @Nullable PlayerData
    load(UUID uuid)
    Loads the player data from the storage system.
    void
    save(PlayerData playerData)
    Saves the player data to the storage system.
  • Method Details

    • save

      void save(PlayerData playerData)
      Saves the player data to the storage system.
      Parameters:
      playerData - The player data to save.
    • load

      @Nullable @Nullable PlayerData load(String uuid)
      Loads the player data from the storage system.
      Parameters:
      uuid - The UUID of the player to load.
      Returns:
      The player data of the player.
    • load

      @Nullable @Nullable PlayerData load(UUID uuid)
      Loads the player data from the storage system.
      Parameters:
      uuid - The UUID of the player to load.
      Returns:
      The player data of the player.
    • getTopBalances

      Map<UUID,Double> getTopBalances(int topN)
      Gets the top N players with the highest balances.
      Parameters:
      topN - The number of top players to retrieve.
      Returns:
      A map of player UUIDs and their balances, sorted by balance in descending order.