Class LeaderboardController


  • public class LeaderboardController
    extends java.lang.Object
    Controller that handles retrieving and updating leaderboards.
    • Method Detail

      • getTotalPointsLeaderboard

        public void getTotalPointsLeaderboard​(java.util.function.BiConsumer<java.lang.Exception,​Leaderboard<PlayerLeaderboardEntry>> callback)
        Retrieve the total points leaderboard in descending order.
        Parameters:
        callback - callback to call with leaderboard
      • getTopScansLeaderboard

        public void getTopScansLeaderboard​(java.util.function.BiConsumer<java.lang.Exception,​Leaderboard<PlayerLeaderboardEntry>> callback)
        Retrieve the top scans leaderboard in descending order.
        Parameters:
        callback - callback to call with leaderboard
      • getTopQRCodesLeaderboard

        public void getTopQRCodesLeaderboard​(java.util.function.BiConsumer<java.lang.Exception,​Leaderboard<QRCodeLeaderboardEntry>> callback)
        Retrieve the top QRCodes points value leaderboard in descending order.
        Parameters:
        callback - callback to call with leaderboard
      • getTopQRCodesByRegionLeaderboard

        public void getTopQRCodesByRegionLeaderboard​(java.util.function.BiConsumer<java.lang.Exception,​java.util.List<Leaderboard<QRCodeLeaderboardEntry>>> callback)
        Retrieve the top QRCode points value leaderboard by region in descending order.
        Parameters:
        callback - callback to call with the leaderboards mapped by their city.
      • handleEntryClick

        public void handleEntryClick​(PlayerLeaderboardEntry entry)
        Called when a player leaderboard entry is clicked
        Parameters:
        entry - player entry
      • handleEntryClick

        public void handleEntryClick​(QRCodeLeaderboardEntry entry)
        Called when a qr leaderboard entry is clicked
        Parameters:
        entry - qr entry
      • onFilterButtonClick

        public void onFilterButtonClick()
        Called when the filter button is clicked
      • setIsFilteredByFollowedPlayers

        public void setIsFilteredByFollowedPlayers​(boolean filteredByFollowedPlayers)
        Modify whether or not the leaderboards requested should only filter to followed players
        Parameters:
        filteredByFollowedPlayers - whether or not to apply the filter
      • isFilteredByFollowedPlayers

        public boolean isFilteredByFollowedPlayers()
        Check if the leaderboard is currently filtering to followed players
        Returns:
        if the filter is active
      • getGameController

        public GameController getGameController()
        Retrieve the game controller
        Returns:
        game controller
      • getFragment

        public LeaderboardFragment getFragment()
        Retrieve the leaderboard fragment
        Returns:
        fragment