Struct AchievementUnlockRecord
The stored proof that a player unlocked an achievement: when it happened, which screenshot
was captured for it, how many points it awarded, and whether the unlock has reached the
platform account yet.
Immutable value object; every mutation produces a copy through one of the With helpers.
Assembly: Serenity.Achievements.Domain.dll
Syntax
public readonly struct AchievementUnlockRecord : IEquatable<AchievementUnlockRecord>
Remarks
Constructors
AchievementUnlockRecord(AchievementId, PlayerId, long, string, int, bool, long)
Creates a new AchievementUnlockRecord with the specified data.
Declaration
public AchievementUnlockRecord(AchievementId achievement, PlayerId player, long unlockedAtUtcTicks, string screenshotKey, int pointsAwarded, bool platformSynced, long revision)
Parameters
| Type |
Name |
Description |
| AchievementId |
achievement |
The achievement that was unlocked.
|
| PlayerId |
player |
The player who unlocked it.
|
| long |
unlockedAtUtcTicks |
The UTC timestamp (in ticks) at which the unlock happened.
|
| string |
screenshotKey |
The blob key of the captured screenshot. May be null.
|
| int |
pointsAwarded |
The points this unlock awarded.
|
| bool |
platformSynced |
Whether this unlock has reached the platform account.
|
| long |
revision |
The monotonic write stamp this row was last persisted under.
|
Fields
Achievement
The achievement that was unlocked.
Declaration
public readonly AchievementId Achievement
Field Value
PlatformSynced
Whether this unlock has been mirrored to the platform account.
Declaration
public readonly bool PlatformSynced
Field Value
Player
The player who unlocked it.
Declaration
public readonly PlayerId Player
Field Value
PointsAwarded
The points this unlock awarded.
Declaration
public readonly int PointsAwarded
Field Value
Revision
The monotonic write stamp this row was last persisted under.
Declaration
public readonly long Revision
Field Value
ScreenshotKey
The blob key of the screenshot captured for this unlock. Null when none was captured.
Declaration
public readonly string ScreenshotKey
Field Value
UnlockedAtUtcTicks
The UTC timestamp (in ticks) at which the unlock happened.
Declaration
public readonly long UnlockedAtUtcTicks
Field Value
Properties
HasScreenshot
Whether a screenshot blob key is attached to this record.
Declaration
public bool HasScreenshot { get; }
Property Value
Methods
Equals(AchievementUnlockRecord)
Declaration
public bool Equals(AchievementUnlockRecord other)
Parameters
Returns
Equals(object)
Declaration
public override bool Equals(object obj)
Parameters
| Type |
Name |
Description |
| object |
obj |
|
Returns
Overrides
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Overrides
ToString()
Declaration
public override string ToString()
Returns
Overrides
WithPlatformSynced(bool)
Returns a copy of this record carrying the given platform-sync state.
Declaration
public AchievementUnlockRecord WithPlatformSynced(bool platformSynced)
Parameters
| Type |
Name |
Description |
| bool |
platformSynced |
Whether the unlock has reached the platform account.
|
Returns
WithRevision(long)
Returns a copy of this record carrying the given monotonic write stamp.
Declaration
public AchievementUnlockRecord WithRevision(long revision)
Parameters
| Type |
Name |
Description |
| long |
revision |
The write stamp the next persist uses.
|
Returns
WithScreenshotKey(string)
Returns a copy of this record carrying the given screenshot key.
Declaration
public AchievementUnlockRecord WithScreenshotKey(string screenshotKey)
Parameters
| Type |
Name |
Description |
| string |
screenshotKey |
The blob key of the captured screenshot.
|
Returns
Operators
operator ==(AchievementUnlockRecord, AchievementUnlockRecord)
Declaration
public static bool operator ==(AchievementUnlockRecord left, AchievementUnlockRecord right)
Parameters
Returns
operator !=(AchievementUnlockRecord, AchievementUnlockRecord)
Declaration
public static bool operator !=(AchievementUnlockRecord left, AchievementUnlockRecord right)
Parameters
Returns
Implements