logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class CheckpointsSection

    ISaveSection holding every checkpoint payload for the owning save slot: a map of caller-chosen checkpoint key to opaque byte payload, encoded as a JSON object of checkpoint key to base64 string.

    Inheritance
    object
    CheckpointsSection
    Implements
    ISaveSection
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    Namespace: Serenity.GameSave.Domain.Sections
    Assembly: Serenity.GameSave.Domain.dll
    Syntax
    public sealed class CheckpointsSection : ISaveSection
    Remarks

    This section treats checkpoint keys and payloads as opaque, deliberately mirroring Serenity.Checkpoint.Application.Interfaces.ICheckpointStore's own black-box contract — it has no dependency on the Checkpoint aggregate. A caller composing the two together (see Serenity.GameSave.Infrastructure.Stores.ActiveSlotKeyValueStore) supplies checkpoint slot names (e.g. CheckpointSlot.ToString()) as the checkpoint key.

    Constructors

    CheckpointsSection()

    Declaration
    public CheckpointsSection()

    Properties

    CheckpointKeys

    Every checkpoint key currently held, in first-write order.

    Declaration
    public IReadOnlyList<string> CheckpointKeys { get; }
    Property Value
    Type Description
    IReadOnlyList<string>

    SectionKey

    The stable key this section is stored under within a SaveDocument.

    Declaration
    public string SectionKey { get; }
    Property Value
    Type Description
    string

    Methods

    Deserialize(string)

    Restores every checkpoint payload from payload. A null or empty payload resets this section to holding no checkpoints.

    Declaration
    public void Deserialize(string payload)
    Parameters
    Type Name Description
    string payload

    HasPayload(string)

    Checks whether a payload is stored under checkpointKey.

    Declaration
    public bool HasPayload(string checkpointKey)
    Parameters
    Type Name Description
    string checkpointKey
    Returns
    Type Description
    bool

    RemovePayload(string)

    Removes the payload stored under checkpointKey. A missing key is a no-op.

    Declaration
    public bool RemovePayload(string checkpointKey)
    Parameters
    Type Name Description
    string checkpointKey
    Returns
    Type Description
    bool

    true when a payload was removed; otherwise false.

    Serialize()

    Serializes this section's current state to JSON.

    Declaration
    public string Serialize()
    Returns
    Type Description
    string

    SetPayload(string, byte[])

    Sets the payload stored under checkpointKey, appending it to CheckpointKeys the first time this key is set.

    Declaration
    public void SetPayload(string checkpointKey, byte[] payload)
    Parameters
    Type Name Description
    string checkpointKey
    byte[] payload
    Exceptions
    Type Condition
    ArgumentException

    Thrown when checkpointKey is null or empty.

    TryGetPayload(string, out byte[])

    Gets the payload stored under checkpointKey, if any.

    Declaration
    public bool TryGetPayload(string checkpointKey, out byte[] payload)
    Parameters
    Type Name Description
    string checkpointKey
    byte[] payload
    Returns
    Type Description
    bool

    Implements

    ISaveSection
    In this article
    © 2026 Serenity. All Rights Reserved