Class LeaderboardDefinition
Configuration for a single leaderboard board: which score metric feeds it, how its entries are ordered, how retention is handled, and how many entries it keeps.
Inherited Members
Namespace: Serenity.Leaderboard.Domain.Entities
Assembly: Serenity.Leaderboard.Domain.dll
Syntax
public class LeaderboardDefinition
Constructors
LeaderboardDefinition(BoardId, string, ScoreKey, LeaderboardSortDirection, LeaderboardRetentionMode, int)
Creates a new LeaderboardDefinition with the specified configuration.
Declaration
public LeaderboardDefinition(BoardId board, string displayName, ScoreKey sourceMetric, LeaderboardSortDirection direction, LeaderboardRetentionMode retentionMode, int maxEntries)
Parameters
| Type | Name | Description |
|---|---|---|
| BoardId | board | The identifier of the board this definition configures. |
| string | displayName | The display name for this board. Cannot be null. |
| ScoreKey | sourceMetric | The score metric this board is fed from. |
| LeaderboardSortDirection | direction | The ordering used to rank entries on this board. |
| LeaderboardRetentionMode | retentionMode | How this board retains submitted entries. |
| int | maxEntries | The maximum number of raw entries kept for this board — a literal per-entry cap in ranking order (see MaxEntries). Zero means unbounded. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | Thrown when |
| ArgumentNullException | Thrown when |
Fields
Board
The identifier of the board this definition configures.
Declaration
public readonly BoardId Board
Field Value
| Type | Description |
|---|---|
| BoardId |
Direction
The ordering used to rank entries on this board.
Declaration
public readonly LeaderboardSortDirection Direction
Field Value
| Type | Description |
|---|---|
| LeaderboardSortDirection |
DisplayName
The display name for this board.
Declaration
public readonly string DisplayName
Field Value
| Type | Description |
|---|---|
| string |
MaxEntries
The maximum number of raw entries kept for this board — a literal per-entry cap. Stores keep only the best MaxEntries entries in ranking order, so under FullHistory this bounds the stored history itself, not just the number of ranked players. Zero means unbounded.
Declaration
public readonly int MaxEntries
Field Value
| Type | Description |
|---|---|
| int |
RetentionMode
How this board retains submitted entries.
Declaration
public readonly LeaderboardRetentionMode RetentionMode
Field Value
| Type | Description |
|---|---|
| LeaderboardRetentionMode |
SourceMetric
The score metric this board is fed from.
Declaration
public readonly ScoreKey SourceMetric
Field Value
| Type | Description |
|---|---|
| ScoreKey |
Properties
HasEntryLimit
Whether this board enforces a maximum entry count.
Declaration
public bool HasEntryLimit { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Methods
ToString()
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string |