logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Struct LeaderboardFieldSelection

    An author-supplied, comma-separated, ordered selection of LeaderboardEntryField values, parsed once at construction.

    Implements
    IEquatable<LeaderboardFieldSelection>
    Inherited Members
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetType()
    Namespace: Serenity.Leaderboard.Domain.ValueObjects
    Assembly: Serenity.Leaderboard.Domain.dll
    Syntax
    public readonly struct LeaderboardFieldSelection : IEquatable<LeaderboardFieldSelection>
    Remarks

    Immutable value object that never throws on invalid content: runtime authoring (HudArgumentParser.TryConstructFromText) invokes a value object's single-string constructor from inside a try/catch and treats any exception as "not a match" for that constructor, so a throwing constructor would just silently fail chain resolution instead of reporting anything useful. IsValid is this type's own well-formedness signal, mirroring how BoardId reports an empty value instead of throwing.

    Constructors

    LeaderboardFieldSelection(string)

    Creates a new LeaderboardFieldSelection by parsing commaSeparatedFields.

    Declaration
    public LeaderboardFieldSelection(string commaSeparatedFields)
    Parameters
    Type Name Description
    string commaSeparatedFields

    Comma-separated, case-insensitive field names, whitespace trimmed around each. Whitelist: DisplayName, Value, Rank, Player, Metadata. An unknown name or empty text makes the selection invalid instead of throwing.

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown when commaSeparatedFields is null.

    Fields

    FieldNames

    The whitelisted field names, in the canonical order an authoring UI should offer them. Single source of truth shared with the HUD Builder's option provider.

    Declaration
    public static readonly string[] FieldNames
    Field Value
    Type Description
    string[]

    Fields

    The parsed fields, in authored order. Empty when IsValid is false.

    Declaration
    public readonly IReadOnlyList<LeaderboardEntryField> Fields
    Field Value
    Type Description
    IReadOnlyList<LeaderboardEntryField>

    IsValid

    Whether every authored name was recognized and at least one field was named.

    Declaration
    public readonly bool IsValid
    Field Value
    Type Description
    bool

    Value

    The comma-separated text this selection was parsed from.

    Declaration
    public readonly string Value
    Field Value
    Type Description
    string

    Methods

    Equals(LeaderboardFieldSelection)

    Ordinal equality over the raw authored text, mirroring BoardId — intentional raw-text equality, not semantic field-set equality. Two selections with identical parsed Fields but differently-cased or differently-spaced authored text (e.g. "Rank,DisplayName" vs "rank, displayname") are NOT equal.

    Declaration
    public bool Equals(LeaderboardFieldSelection other)
    Parameters
    Type Name Description
    LeaderboardFieldSelection other
    Returns
    Type Description
    bool

    Equals(object)

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    object obj
    Returns
    Type Description
    bool
    Overrides
    ValueType.Equals(object)

    GetHashCode()

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int
    Overrides
    ValueType.GetHashCode()

    ToString()

    Declaration
    public override string ToString()
    Returns
    Type Description
    string
    Overrides
    ValueType.ToString()

    Operators

    operator ==(LeaderboardFieldSelection, LeaderboardFieldSelection)

    Declaration
    public static bool operator ==(LeaderboardFieldSelection left, LeaderboardFieldSelection right)
    Parameters
    Type Name Description
    LeaderboardFieldSelection left
    LeaderboardFieldSelection right
    Returns
    Type Description
    bool

    operator !=(LeaderboardFieldSelection, LeaderboardFieldSelection)

    Declaration
    public static bool operator !=(LeaderboardFieldSelection left, LeaderboardFieldSelection right)
    Parameters
    Type Name Description
    LeaderboardFieldSelection left
    LeaderboardFieldSelection right
    Returns
    Type Description
    bool

    Implements

    IEquatable<T>
    In this article
    © 2026 Serenity. All Rights Reserved