Class LeaderboardColumnLayout
A resolved, engine-free description of how a leaderboard view's rows split into columns: which columns
show, in what order, with what header/width/alignment, whether a header row renders, and how an
ACHIEVED_AT column formats its timestamp. Mirrors
UnityLeaderboardViewDefinition.ResolveValueSpec(): authored settings resolve once into the single
shape the rest of the pipeline reads, so callers never carry the raw fields around separately.
Inherited Members
Namespace: Serenity.Leaderboard.Infrastructure.Views
Assembly: Serenity.UnityLeaderboard.Infrastructure.dll
Syntax
public sealed class LeaderboardColumnLayout
Properties
AchievedAtFormat
The ToString(string, IFormatProvider) format string an ACHIEVED_AT column uses. Always a format DateTime can render — FromSettings(IReadOnlyList<LeaderboardColumnSetting>, bool, string) validates it once at resolution time so row mapping never has to guard against a throwing format string.
Declaration
public string AchievedAtFormat { get; }
Property Value
| Type | Description |
|---|---|
| string |
Columns
The columns to render, in author order, with every invisible column already dropped.
Declaration
public IReadOnlyList<LeaderboardColumn> Columns { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyList<LeaderboardColumn> |
Legacy
The layout of a view with no authored columns and headers off: rank, display name and value, content-sized and left-aligned, no header row. Byte-for-byte the shape the runtime rendered before column headers existed.
Declaration
public static LeaderboardColumnLayout Legacy { get; }
Property Value
| Type | Description |
|---|---|
| LeaderboardColumnLayout |
LegacyWithHeaders
Legacy's same three columns, captioned with each kind's default caption (RANK → "Rank", DISPLAY_NAME → "Name", VALUE → "Value") and a header row shown above them. What FromSettings(IReadOnlyList<LeaderboardColumnSetting>, bool, string) resolves to for an asset with no authored columns and headers on.
Declaration
public static LeaderboardColumnLayout LegacyWithHeaders { get; }
Property Value
| Type | Description |
|---|---|
| LeaderboardColumnLayout |
ShowsHeaderRow
Whether a header row renders above the entry rows.
Declaration
public bool ShowsHeaderRow { get; }
Property Value
| Type | Description |
|---|---|
| bool |
ThemePreview
The layout used by theme prefabs' design-time preview rows (ChromePrefabBuilders.BuildLeaderboard):
a fixed-width rank column, a content-sized name column, and a fixed-width right-aligned value column,
no header row.
Declaration
public static LeaderboardColumnLayout ThemePreview { get; }
Property Value
| Type | Description |
|---|---|
| LeaderboardColumnLayout |
Methods
DefaultHeaderText(LeaderboardColumnKind)
The caption a kind column carries by default: the authoring seed the designer's
Columns table writes into a new row's header text (see LeaderboardColumnSettingsGui.OnAdd), and
the resolve-time fallback FromSettings(IReadOnlyList<LeaderboardColumnSetting>, bool, string) falls back to when its author leaves
HeaderText empty — a safety net for hand-built or legacy
definitions, since the designer itself now authors the caption directly instead of leaving the field
blank for this fallback to fill in.
Declaration
public static string DefaultHeaderText(LeaderboardColumnKind kind)
Parameters
| Type | Name | Description |
|---|---|---|
| LeaderboardColumnKind | kind |
Returns
| Type | Description |
|---|---|
| string |
FromSettings(IReadOnlyList<LeaderboardColumnSetting>, bool, string)
Resolves an authored column list into a layout. A null or empty columns resolves
to Legacy when showHeaders is off, or LegacyWithHeaders
when it is on — an asset with no authored columns keeps today's runtime rank/name/value look with
zero authoring, captioned or not per the flag. A non-empty list resolves to only its visible columns,
in author order, with an empty authored header text defaulting to its kind's caption
(DefaultHeaderText(LeaderboardColumnKind)) so a column always has something to show once headers are on; if
every authored column is invisible, the result is a layout with zero columns (nothing renders) rather
than silently falling back to Legacy — a later slice's authoring scanner flags an
all-hidden column list as an authoring mistake instead of this method masking it.
Declaration
public static LeaderboardColumnLayout FromSettings(IReadOnlyList<LeaderboardColumnSetting> columns, bool showHeaders, string achievedAtFormat)
Parameters
| Type | Name | Description |
|---|---|---|
| IReadOnlyList<LeaderboardColumnSetting> | columns | The authored columns, in author order. |
| bool | showHeaders | Whether a header row renders above the entry rows. |
| string | achievedAtFormat | The DateTime format string an ACHIEVED_AT column uses. Null, empty, or a format
DateTime cannot render falls back to |
Returns
| Type | Description |
|---|---|
| LeaderboardColumnLayout |
HeaderCells()
This layout's header text, one per column, in column order.
Declaration
public IReadOnlyList<string> HeaderCells()
Returns
| Type | Description |
|---|---|
| IReadOnlyList<string> |