logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class LeaderboardRowContentMapper

    Maps ranked domain entries to already-formatted LeaderboardRowContent rows. Pure: no Unity or engine dependencies, so it can be unit tested without an editor/player context.

    Inheritance
    object
    LeaderboardRowContentMapper
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Serenity.Leaderboard.Infrastructure.Views
    Assembly: Serenity.UnityLeaderboard.Infrastructure.dll
    Syntax
    public static class LeaderboardRowContentMapper

    Methods

    Map(IReadOnlyList<RankedEntry>, LeaderboardValueFormat, Func<string, string>)

    Maps every entry in rankedEntries to a display-ready row, in order, using the legacy rank/name/value layout.

    Declaration
    public static IReadOnlyList<LeaderboardRowContent> Map(IReadOnlyList<RankedEntry> rankedEntries, LeaderboardValueFormat valueFormat, Func<string, string> translateOrNull = null)
    Parameters
    Type Name Description
    IReadOnlyList<RankedEntry> rankedEntries

    The ranked entries to map (e.g. a LeaderboardPage's entries).

    LeaderboardValueFormat valueFormat

    The format applied to each entry's raw value.

    Func<string, string> translateOrNull

    Resolves a translated string for a translating column's authored key, or null when no translator is available (e.g. the Leaderboard View Designer's preview, which shows raw key text instead).

    Returns
    Type Description
    IReadOnlyList<LeaderboardRowContent>

    One row per entry, preserving order. Empty when rankedEntries is null or empty.

    Map(IReadOnlyList<RankedEntry>, ValueDisplaySpec, LeaderboardColumnLayout, Func<string, string>)

    Maps every entry in rankedEntries to a display-ready row, in order, with one cell per layout column.

    Declaration
    public static IReadOnlyList<LeaderboardRowContent> Map(IReadOnlyList<RankedEntry> rankedEntries, ValueDisplaySpec valueSpec, LeaderboardColumnLayout layout, Func<string, string> translateOrNull = null)
    Parameters
    Type Name Description
    IReadOnlyList<RankedEntry> rankedEntries

    The ranked entries to map (e.g. a LeaderboardPage's entries).

    ValueDisplaySpec valueSpec

    The already-resolved display spec applied to a VALUE column's raw value.

    LeaderboardColumnLayout layout

    The resolved column layout that determines which cells each row has, and in what order.

    Func<string, string> translateOrNull

    Resolves a translated string for a translating column's authored key, or null when no translator is available (e.g. the Leaderboard View Designer's preview, which shows raw key text instead).

    Returns
    Type Description
    IReadOnlyList<LeaderboardRowContent>

    One row per entry, preserving order. Empty when rankedEntries is null or empty.

    Map(IReadOnlyList<RankedEntry>, ValueDisplaySpec, Func<string, string>)

    Maps every entry in rankedEntries to a display-ready row, in order, using the legacy rank/name/value layout.

    Declaration
    public static IReadOnlyList<LeaderboardRowContent> Map(IReadOnlyList<RankedEntry> rankedEntries, ValueDisplaySpec valueSpec, Func<string, string> translateOrNull = null)
    Parameters
    Type Name Description
    IReadOnlyList<RankedEntry> rankedEntries

    The ranked entries to map (e.g. a LeaderboardPage's entries).

    ValueDisplaySpec valueSpec

    The already-resolved display spec applied to each entry's raw value.

    Func<string, string> translateOrNull

    Resolves a translated string for a translating column's authored key, or null when no translator is available (e.g. the Leaderboard View Designer's preview, which shows raw key text instead).

    Returns
    Type Description
    IReadOnlyList<LeaderboardRowContent>

    One row per entry, preserving order. Empty when rankedEntries is null or empty.

    MapSingle(RankedEntry, LeaderboardValueFormat, Func<string, string>)

    Maps a single ranked entry to a display-ready row, using the legacy rank/name/value layout.

    Declaration
    public static LeaderboardRowContent MapSingle(RankedEntry rankedEntry, LeaderboardValueFormat valueFormat, Func<string, string> translateOrNull = null)
    Parameters
    Type Name Description
    RankedEntry rankedEntry

    The ranked entry to map.

    LeaderboardValueFormat valueFormat

    The format applied to the entry's raw value.

    Func<string, string> translateOrNull

    Resolves a translated string for a translating column's authored key, or null when no translator is available (e.g. the Leaderboard View Designer's preview, which shows raw key text instead).

    Returns
    Type Description
    LeaderboardRowContent

    MapSingle(RankedEntry, ValueDisplaySpec, LeaderboardColumnLayout, Func<string, string>)

    Maps a single ranked entry to a display-ready row, with one cell per layout column.

    Declaration
    public static LeaderboardRowContent MapSingle(RankedEntry rankedEntry, ValueDisplaySpec valueSpec, LeaderboardColumnLayout layout, Func<string, string> translateOrNull = null)
    Parameters
    Type Name Description
    RankedEntry rankedEntry

    The ranked entry to map.

    ValueDisplaySpec valueSpec

    The already-resolved display spec applied to a VALUE column's raw value.

    LeaderboardColumnLayout layout

    The resolved column layout that determines which cells the row has, and in what order.

    Func<string, string> translateOrNull

    Resolves a translated string for a translating column's authored key, or null when no translator is available (e.g. the Leaderboard View Designer's preview, which shows raw key text instead).

    Returns
    Type Description
    LeaderboardRowContent

    MapSingle(RankedEntry, ValueDisplaySpec, Func<string, string>)

    Maps a single ranked entry to a display-ready row, using the legacy rank/name/value layout.

    Declaration
    public static LeaderboardRowContent MapSingle(RankedEntry rankedEntry, ValueDisplaySpec valueSpec, Func<string, string> translateOrNull = null)
    Parameters
    Type Name Description
    RankedEntry rankedEntry

    The ranked entry to map.

    ValueDisplaySpec valueSpec

    The already-resolved display spec applied to the entry's raw value.

    Func<string, string> translateOrNull

    Resolves a translated string for a translating column's authored key, or null when no translator is available (e.g. the Leaderboard View Designer's preview, which shows raw key text instead).

    Returns
    Type Description
    LeaderboardRowContent
    In this article
    © 2026 Serenity. All Rights Reserved