Class AchievementSyncRecord
One achievement in the neutral wire form the sync system pushes to and pulls from a storefront.
Inherited Members
Namespace: Serenity.Achievements.Application.Sync
Assembly: Serenity.Achievements.Application.dll
Syntax
public sealed class AchievementSyncRecord
Remarks
Where AchievementManifestRow carries localization keys for a bulk-import sheet, a sync record carries the actual localized text and icon bytes a storefront's own editor stores — the two exist for different jobs and merging them would mean widening the manifest exporter with fields it never reads, or widening this record with the trophy-grade concerns a live sync round-trip has no use for.
PlatformExtras carries platform-specific ballast (for example Steam's internal stat id and bit id) that a record round-trips untouched purely so a push can hand it back to the platform exactly as pulled. It is opaque to the sync system: never diffed against a previous snapshot and never shown to an author as a change.
Constructors
AchievementSyncRecord(Fields)
Creates a sync record.
Declaration
public AchievementSyncRecord(AchievementSyncRecord.Fields fields)
Parameters
| Type | Name | Description |
|---|---|---|
| AchievementSyncRecord.Fields | fields | The values to build it from. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | When no fields were given. |
Properties
ApiName
Declaration
public string ApiName { get; }
Property Value
| Type | Description |
|---|---|
| string | The platform-side identity/match key (Steam API name, Xbox id, and so on). |
Description
Declaration
public LocalizedTextSet Description { get; }
Property Value
| Type | Description |
|---|---|
| LocalizedTextSet | The localized description. |
DisplayName
Declaration
public LocalizedTextSet DisplayName { get; }
Property Value
| Type | Description |
|---|---|
| LocalizedTextSet | The localized display name. |
DisplayOrder
Declaration
public int DisplayOrder { get; }
Property Value
| Type | Description |
|---|---|
| int | Where the achievement is listed relative to its siblings. |
HeldUnlockedIconStorefrontReference
Declaration
public string HeldUnlockedIconStorefrontReference { get; }
Property Value
| Type | Description |
|---|---|
| string | The storefront reference the held unlocked icon is an unchanged saved copy of, or empty when it is not one (or the record is a storefront's). |
HoldsLockedIcon
Declaration
public bool HoldsLockedIcon { get; }
Property Value
| Type | Description |
|---|---|
| bool | Whether the authored achievement already holds a locked icon; false for a record a storefront returned. |
HoldsUnlockedIcon
Declaration
public bool HoldsUnlockedIcon { get; }
Property Value
| Type | Description |
|---|---|
| bool | Whether the authored achievement already holds an unlocked icon; false for a record a storefront returned. |
IsHidden
Declaration
public bool IsHidden { get; }
Property Value
| Type | Description |
|---|---|
| bool | Whether the achievement stays concealed until unlocked. |
LocalId
Declaration
public string LocalId { get; }
Property Value
| Type | Description |
|---|---|
| string | The Serenity achievement id, or empty for a row that only exists on the platform. |
LockedIcon
Declaration
public AchievementIconPayload LockedIcon { get; }
Property Value
| Type | Description |
|---|---|
| AchievementIconPayload | The icon shown while the achievement is still locked. |
PlatformExtras
Declaration
public IReadOnlyDictionary<string, string> PlatformExtras { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyDictionary<string, string> | Platform-specific ballast this record round-trips untouched. See the class remarks. |
ProgressTarget
Declaration
public long ProgressTarget { get; }
Property Value
| Type | Description |
|---|---|
| long | The progress numerator that unlocks it. Zero is a single-step unlock. |
StorefrontLockedIcon
Declaration
public AchievementStorefrontIcon StorefrontLockedIcon { get; }
Property Value
| Type | Description |
|---|---|
| AchievementStorefrontIcon | The locked icon the storefront holds and a pull can download; none for a record built from an authored achievement. |
StorefrontUnlockedIcon
Declaration
public AchievementStorefrontIcon StorefrontUnlockedIcon { get; }
Property Value
| Type | Description |
|---|---|
| AchievementStorefrontIcon | The unlocked icon the storefront holds and a pull can download; none for a record built from an authored achievement. |
TextIsLiteral
Declaration
public bool TextIsLiteral { get; }
Property Value
| Type | Description |
|---|---|
| bool | Whether the display name and description are literal text held in the definition itself rather than keys into a string table — the records a pull can offer to move into one. |
UnlockedIcon
Declaration
public AchievementIconPayload UnlockedIcon { get; }
Property Value
| Type | Description |
|---|---|
| AchievementIconPayload | The icon shown once the achievement is unlocked. |
Methods
WithFields(LocalizedTextSet, LocalizedTextSet, bool, AchievementIconPayload, AchievementIconPayload)
Returns a copy of this record with different display name, description, hidden flag, and icons.
Declaration
public AchievementSyncRecord WithFields(LocalizedTextSet displayName, LocalizedTextSet description, bool isHidden, AchievementIconPayload unlockedIcon, AchievementIconPayload lockedIcon)
Parameters
| Type | Name | Description |
|---|---|---|
| LocalizedTextSet | displayName | The copy's localized display name. |
| LocalizedTextSet | description | The copy's localized description. |
| bool | isHidden | The copy's hidden flag. |
| AchievementIconPayload | unlockedIcon | The copy's unlocked icon. |
| AchievementIconPayload | lockedIcon | The copy's locked icon. |
Returns
| Type | Description |
|---|---|
| AchievementSyncRecord |
WithIcons(AchievementIconPayload, AchievementIconPayload)
Returns a copy of this record with different icon payloads.
Declaration
public AchievementSyncRecord WithIcons(AchievementIconPayload unlockedIcon, AchievementIconPayload lockedIcon)
Parameters
| Type | Name | Description |
|---|---|---|
| AchievementIconPayload | unlockedIcon | The copy's unlocked icon. |
| AchievementIconPayload | lockedIcon | The copy's locked icon. |
Returns
| Type | Description |
|---|---|
| AchievementSyncRecord |
WithPlatformExtras(IReadOnlyDictionary<string, string>)
Returns a copy of this record with different platform-specific ballast.
Declaration
public AchievementSyncRecord WithPlatformExtras(IReadOnlyDictionary<string, string> platformExtras)
Parameters
| Type | Name | Description |
|---|---|---|
| IReadOnlyDictionary<string, string> | platformExtras | The platform extras the copy carries. |
Returns
| Type | Description |
|---|---|
| AchievementSyncRecord |