Beamable SDK
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Properties | List of all members
Beamable.EasyFeatures.BasicLeaderboard.BasicLeaderboardPlayerSystem Class Reference

This is our basic leaderboard system — It exposes some APIs to fetch data from the backend and rearranges that API with basic information from our backend into a format more easily usable by UI. It gets RankEntrys from our platform, parses them, loads data relevant and caches that data in a format that's easier to work with for the things we want to do. In this case, it simply caches the leaderboards names, avatar sprites, rank and score values in sequential parallel list. More...

Inheritance diagram for Beamable.EasyFeatures.BasicLeaderboard.BasicLeaderboardPlayerSystem:
Inheritance graph
[legend]
Collaboration diagram for Beamable.EasyFeatures.BasicLeaderboard.BasicLeaderboardPlayerSystem:
Collaboration graph
[legend]

Public Member Functions

 BasicLeaderboardPlayerSystem (LeaderboardService leaderboardService, IUserContext ctx)
 Constructs with the appropriate dependencies. Is injected by BeamContext dependency injection framework.
 
virtual async Promise FetchLeaderboardData (string leaderboardId, int firstEntryId, int entriesAmount, bool focus=true, Action< BasicLeaderboardView.ILeaderboardDeps > onComplete=null)
 
virtual async Promise FetchLeaderboardData (LeaderboardRef leaderboardRef, int firstEntryId, int entriesAmount, bool focus=true, Action< BasicLeaderboardView.ILeaderboardDeps > onComplete=null)
 
virtual void RegisterLeaderboardEntries (LeaderboardRef leaderboardRef, List< RankEntry > rankEntries, RankEntry userRankEntry)
 
virtual void RegisterLeaderboardEntries (string leaderboardId, List< RankEntry > rankEntries, RankEntry userRankEntry)
 
virtual void ClearLeaderboardData (LeaderboardRef leaderboardRef)
 
virtual void ClearLeaderboardData (string leaderboardId)
 
virtual void BuildLeaderboardClientData (List< RankEntry > rankEntries, RankEntry userRankEntry, ref List< string > aliases, ref List< long > ranks, ref List< double > scores, ref List< Sprite > avatars, ref int? userRank)
 The actual data transformation function that converts rank entries into data that is relevant for our BasicLeaderboardView.ILeaderboardDeps.
 

Public Attributes

string FocusedLeaderboardId
 
readonly Dictionary< string, List< string > > PerLeaderboardAliases
 
readonly Dictionary< string, List< Sprite > > PerLeaderboardAvatars
 
readonly Dictionary< string, List< long > > PerLeaderboardRanks
 
readonly Dictionary< string, List< double > > PerLeaderboardScores
 
readonly Dictionary< string, int?> PerLeaderboardUserIdx
 

Protected Member Functions

virtual Sprite GetAvatar (string id)
 Just a helper that gets a reference to the avatar image that matches the given id.
 

Protected Attributes

readonly IUserContext _userContext
 Reference to the current user's data.
 
readonly LeaderboardService _leaderboardService
 Reference to our platform's leaderboard API.
 

Properties

virtual IEnumerable< BasicLeaderboardView.BasicLeaderboardViewEntryEntries [get]
 
virtual IReadOnlyList< string > Aliases [get]
 
virtual IReadOnlyList< long > Ranks [get]
 
virtual IReadOnlyList< double > Scores [get]
 
virtual IReadOnlyList< Sprite > Avatars [get]
 
virtual int PlayerIndexInLeaderboard [get]
 
virtual string PlayerAlias [get]
 
virtual long PlayerRank [get]
 
virtual double PlayerScore [get]
 
virtual Sprite PlayerAvatar [get]
 
- Properties inherited from Beamable.EasyFeatures.BasicLeaderboard.BasicLeaderboardView.ILeaderboardDeps
IEnumerable< BasicLeaderboardViewEntryEntries [get]
 
IReadOnlyList< long > Ranks [get]
 
IReadOnlyList< double > Scores [get]
 
IReadOnlyList< string > Aliases [get]
 
IReadOnlyList< Sprite > Avatars [get]
 
int PlayerIndexInLeaderboard [get]
 
string PlayerAlias [get]
 
long PlayerRank [get]
 
double PlayerScore [get]
 
Sprite PlayerAvatar [get]
 

Detailed Description

This is our basic leaderboard system — It exposes some APIs to fetch data from the backend and rearranges that API with basic information from our backend into a format more easily usable by UI. It gets RankEntrys from our platform, parses them, loads data relevant and caches that data in a format that's easier to work with for the things we want to do. In this case, it simply caches the leaderboards names, avatar sprites, rank and score values in sequential parallel list.


The documentation for this class was generated from the following file: