Class UnityLeaderboardTopEntryService
Locator-registered ILeaderboardTopEntryService implementation: a per-board cache
refreshed in the background, read synchronously by any number of HUD-authored chains.
Inheritance
UnityLeaderboardTopEntryService
Assembly: Serenity.UnityLeaderboard.Infrastructure.dll
Syntax
public class UnityLeaderboardTopEntryService : ILeaderboardTopEntryService, IService, IFoundationSettings
Constructors
UnityLeaderboardTopEntryService(ILeaderboardService, ILeaderboardSettings, IEventDispatcherService, ILogService, Func<IScoreService>)
Declaration
public UnityLeaderboardTopEntryService(ILeaderboardService leaderboardService, ILeaderboardSettings settings, IEventDispatcherService eventDispatcherService, ILogService logService, Func<IScoreService> scoreServiceResolver)
Parameters
| Type |
Name |
Description |
| ILeaderboardService |
leaderboardService |
Service every board's top-1 row is fetched through.
|
| ILeaderboardSettings |
settings |
Board configuration, player-identity source and default display name.
|
| IEventDispatcherService |
eventDispatcherService |
Dispatcher this service subscribes to for LeaderboardEntrySubmittedSignal and
LeaderboardClearedSignal. May be null; the service still self-primes on
first read without one, it just never proactively re-fetches on a signal.
|
| ILogService |
logService |
Logging service. May be null.
|
| Func<IScoreService> |
scoreServiceResolver |
Resolves IScoreService lazily. The Score and Leaderboard aggregates both
install as independent Initialization Pipeline tasks whose relative order is configured per
project (see UnityLeaderboardInstallationStep's installer), so this service cannot
assume the score service already exists at construction time — it resolves through this
delegate on first need and caches the first non-null result.
|
Exceptions
| Type |
Condition |
| ArgumentNullException |
Thrown when leaderboardService, settings or
scoreServiceResolver is null.
|
Properties
Guid
Declaration
public string Guid { get; set; }
Property Value
Id
Declaration
public string Id { get; set; }
Property Value
LogService
Declaration
public ILogService LogService { get; set; }
Property Value
Methods
TryGetDisplayText(BoardId, LeaderboardFieldSelection, string, bool, out string)
Declaration
public bool TryGetDisplayText(BoardId board, LeaderboardFieldSelection fields, string separator, bool includeLocalPlayerScore, out string text)
Parameters
Returns
TryGetTopDisplayName(BoardId, bool, out string)
Declaration
public bool TryGetTopDisplayName(BoardId board, bool includeLocalPlayerScore, out string displayName)
Parameters
Returns
TryGetTopValue(BoardId, bool, out float)
Declaration
public bool TryGetTopValue(BoardId board, bool includeLocalPlayerScore, out float value)
Parameters
Returns
Implements