logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    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.

    Inheritance
    object
    LeaderboardDefinition
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    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 board is not valid.

    ArgumentNullException

    Thrown when displayName is null.

    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
    Overrides
    object.ToString()
    In this article
    © 2026 Serenity. All Rights Reserved