Class AchievementRowContent
One achievement as the listing shows it: the text already formatted, and the raw values a sort or a thumbnail lookup still needs. Produced by AchievementRowContentMapper.
Inherited Members
Namespace: Serenity.Achievements.Infrastructure.Views
Assembly: Serenity.Achievements.Infrastructure.dll
Syntax
public sealed class AchievementRowContent
Remarks
Name and Description stay whatever the definition authored — a literal or a localization key, told apart by IsTranslating — because resolving a key needs the localization facility, which is an engine concern this pure mapper has no business reaching for. The view resolves them when it renders the row.
A class rather than a struct: thirteen fields is past the size where copying one by value is cheaper than referencing it, and rows are built once per refresh and only ever read afterwards.
Constructors
AchievementRowContent(string, string, string, bool, string, string, string, bool, bool, double, string, int, int, long)
Creates a new AchievementRowContent with the specified display text and raw values.
Declaration
public AchievementRowContent(string achievementId, string name, string description, bool isTranslating, string progressText, string unlockDateText, string pointsText, bool isUnlocked, bool isHiddenPlaceholder, double progressNormalized, string screenshotKey, int displayOrder, int points, long unlockedAtUtcTicks)
Parameters
| Type | Name | Description |
|---|---|---|
| string | achievementId | The id of the achievement this row shows. |
| string | name | The display name, its localization key, or the concealment placeholder. |
| string | description | The description or its localization key. |
| bool | isTranslating | Whether the name and description are localization keys. |
| string | progressText | The progress rendered as "current / target", or empty. |
| string | unlockDateText | The unlock timestamp rendered for display, or empty. |
| string | pointsText | The awarded points rendered for display. |
| bool | isUnlocked | Whether the current player has unlocked this achievement. |
| bool | isHiddenPlaceholder | Whether this row conceals a still-hidden achievement. |
| double | progressNormalized | The progress as a 0..1 fraction. |
| string | screenshotKey | The blob key of the unlock screenshot, or null. |
| int | displayOrder | The authored ordering hint. |
| int | points | The points this achievement awards. |
| long | unlockedAtUtcTicks | The UTC unlock timestamp in ticks, or zero. |
Fields
AchievementId
The id of the achievement this row shows.
Declaration
public readonly string AchievementId
Field Value
| Type | Description |
|---|---|
| string |
Description
The description, or its localization key. Empty when the row is concealed.
Declaration
public readonly string Description
Field Value
| Type | Description |
|---|---|
| string |
DisplayOrder
The authored ordering hint. Lower values are listed first.
Declaration
public readonly int DisplayOrder
Field Value
| Type | Description |
|---|---|
| int |
IsHiddenPlaceholder
Whether this row conceals a hidden achievement the player has not unlocked yet.
Declaration
public readonly bool IsHiddenPlaceholder
Field Value
| Type | Description |
|---|---|
| bool |
IsTranslating
Whether Name and Description are localization keys.
Declaration
public readonly bool IsTranslating
Field Value
| Type | Description |
|---|---|
| bool |
IsUnlocked
Whether the current player has unlocked this achievement.
Declaration
public readonly bool IsUnlocked
Field Value
| Type | Description |
|---|---|
| bool |
Name
The display name, or its localization key, or the placeholder when the row is concealed.
Declaration
public readonly string Name
Field Value
| Type | Description |
|---|---|
| string |
Points
The points this achievement awards.
Declaration
public readonly int Points
Field Value
| Type | Description |
|---|---|
| int |
PointsText
The points this achievement awards, rendered for display.
Declaration
public readonly string PointsText
Field Value
| Type | Description |
|---|---|
| string |
ProgressNormalized
The progress as a 0..1 fraction, for a progress bar. Always 1 once unlocked.
Declaration
public readonly double ProgressNormalized
Field Value
| Type | Description |
|---|---|
| double |
ProgressText
The progress rendered as "current / target", or empty for a boolean achievement.
Declaration
public readonly string ProgressText
Field Value
| Type | Description |
|---|---|
| string |
ScreenshotKey
The blob key of the unlock screenshot, or null when there is none to show.
Declaration
public readonly string ScreenshotKey
Field Value
| Type | Description |
|---|---|
| string |
UnlockDateText
The unlock timestamp rendered for display, or empty while the achievement is locked.
Declaration
public readonly string UnlockDateText
Field Value
| Type | Description |
|---|---|
| string |
UnlockedAtUtcTicks
The UTC unlock timestamp in ticks, or zero while the achievement is locked.
Declaration
public readonly long UnlockedAtUtcTicks
Field Value
| Type | Description |
|---|---|
| long |
Properties
HasProgress
Whether this row tracks progress worth drawing a bar for.
Declaration
public bool HasProgress { get; }
Property Value
| Type | Description |
|---|---|
| bool |
HasScreenshot
Whether this row has a screenshot the view can show as a thumbnail.
Declaration
public bool HasScreenshot { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Methods
ToString()
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string |