logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    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.

    Implements
    IEquatable<AchievementUnlockRecord>
    Inherited Members
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetType()
    Namespace: Serenity.Achievements.Domain.ValueObjects
    Assembly: Serenity.Achievements.Domain.dll
    Syntax
    public readonly struct AchievementUnlockRecord : IEquatable<AchievementUnlockRecord>
    Remarks

    Revision is the monotonic write stamp the store's upsert-if-newer comparison orders writes by, so a screenshot attached after the unlock never loses to the original row.

    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
    Type Description
    AchievementId

    PlatformSynced

    Whether this unlock has been mirrored to the platform account.

    Declaration
    public readonly bool PlatformSynced
    Field Value
    Type Description
    bool

    Player

    The player who unlocked it.

    Declaration
    public readonly PlayerId Player
    Field Value
    Type Description
    PlayerId

    PointsAwarded

    The points this unlock awarded.

    Declaration
    public readonly int PointsAwarded
    Field Value
    Type Description
    int

    Revision

    The monotonic write stamp this row was last persisted under.

    Declaration
    public readonly long Revision
    Field Value
    Type Description
    long

    ScreenshotKey

    The blob key of the screenshot captured for this unlock. Null when none was captured.

    Declaration
    public readonly string ScreenshotKey
    Field Value
    Type Description
    string

    UnlockedAtUtcTicks

    The UTC timestamp (in ticks) at which the unlock happened.

    Declaration
    public readonly long UnlockedAtUtcTicks
    Field Value
    Type Description
    long

    Properties

    HasScreenshot

    Whether a screenshot blob key is attached to this record.

    Declaration
    public bool HasScreenshot { get; }
    Property Value
    Type Description
    bool

    Methods

    Equals(AchievementUnlockRecord)

    Declaration
    public bool Equals(AchievementUnlockRecord other)
    Parameters
    Type Name Description
    AchievementUnlockRecord other
    Returns
    Type Description
    bool

    Equals(object)

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    object obj
    Returns
    Type Description
    bool
    Overrides
    ValueType.Equals(object)

    GetHashCode()

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int
    Overrides
    ValueType.GetHashCode()

    ToString()

    Declaration
    public override string ToString()
    Returns
    Type Description
    string
    Overrides
    ValueType.ToString()

    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
    Type Description
    AchievementUnlockRecord

    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
    Type Description
    AchievementUnlockRecord

    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
    Type Description
    AchievementUnlockRecord

    Operators

    operator ==(AchievementUnlockRecord, AchievementUnlockRecord)

    Declaration
    public static bool operator ==(AchievementUnlockRecord left, AchievementUnlockRecord right)
    Parameters
    Type Name Description
    AchievementUnlockRecord left
    AchievementUnlockRecord right
    Returns
    Type Description
    bool

    operator !=(AchievementUnlockRecord, AchievementUnlockRecord)

    Declaration
    public static bool operator !=(AchievementUnlockRecord left, AchievementUnlockRecord right)
    Parameters
    Type Name Description
    AchievementUnlockRecord left
    AchievementUnlockRecord right
    Returns
    Type Description
    bool

    Implements

    IEquatable<T>
    In this article
    © 2026 Serenity. All Rights Reserved