Class PlayerProfileFirebaseManager

    • Constructor Detail

      • PlayerProfileFirebaseManager

        public PlayerProfileFirebaseManager()
    • Method Detail

      • addNewPlayerProfile

        public void addNewPlayerProfile​(java.lang.String username,
                                        java.lang.String firstName,
                                        java.lang.String lastName,
                                        java.lang.String contactPhone,
                                        java.lang.String contactEmail,
                                        int totalScore,
                                        int totalScans,
                                        int highestScore,
                                        int lowestScore,
                                        OnUserProfileAddListener listener)
        Adds a new player profile to the database.
        Parameters:
        username - The username of the player.
        contactPhone - The phone number of the player's emergency contact.
        contactEmail - The email address of the player's emergency contact.
        totalScore - The total score of the player. Pass in 0 initially.
        totalScans - The total scans of the player. Pass in 0 initially.
        highestScore - The highest score of the player. Pass in 0 initially.
        lowestScore - The lowest score of the player. Pass in 0 initially.
        listener - The listener to handle the result of the operation.
      • deletePlayerProfile

        public void deletePlayerProfile​(java.lang.String username,
                                        OnUserProfileDeleteListener listener)
        Deletes a player profile from the database.
        Parameters:
        username - The username of the player whose profile is to be deleted.
        listener - The listener to handle the result of the operation.
      • getBasicPlayerProfile

        public void getBasicPlayerProfile​(java.lang.String username,
                                          OnBasicPlayerProfileLoadedListener listener)
        Get BasicPlayerProfile object for given username.
        Parameters:
        username - The username of the player.
        listener - The listener to be called when the BasicPlayerProfile is loaded or load fails.
      • getPlayersSortedByHighestScore

        public void getPlayersSortedByHighestScore​(OnPlayerListLoadedListener listener)
        A function that retrieves a list of players sorted by their highest score.
        Parameters:
        listener - The listener to be notified of the result of the function.
      • getPlayersSortedByLowestScore

        public void getPlayersSortedByLowestScore​(OnPlayerListLoadedListener listener)
        A function that retrieves a list of players sorted by their lowest score.
        Parameters:
        listener - The listener to be notified of the result of the function.
      • getPlayersSortedByTotalScore

        public void getPlayersSortedByTotalScore​(OnPlayerListLoadedListener listener)
        A function that retrieves a list of players sorted by their total score.
        Parameters:
        listener - The listener to be notified of the result of the function.
      • getPlayersSortedByTotalScans

        public void getPlayersSortedByTotalScans​(OnPlayerListLoadedListener listener)
        A function that retrieves a list of players sorted by their total score.
        Parameters:
        listener - The listener to be notified of the result of the function.
      • getGlobalRankForTotalScore

        public void getGlobalRankForTotalScore​(java.lang.String userName,
                                               OnGlobalRankLoadedListener listener)
        A function that retrieves the maximum total score globally, user rank and calling users total score.
        Parameters:
        listener - The listener to be notified of the result of the function.
      • getGlobalRankForHighScore

        public void getGlobalRankForHighScore​(java.lang.String userName,
                                              OnGlobalRankLoadedListener listener)
        A function that retrieves the maximum highest score of qrcode globally among all users, user rank and calling users highest score of qrcode.
        Parameters:
        listener - The listener to be notified of the result of the function.