logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Interface ICheckpointService

    Service interface for saving, loading, and querying checkpoints.

    Namespace: Serenity.Checkpoint.Application.Interfaces
    Assembly: Serenity.Checkpoint.Application.dll
    Syntax
    public interface ICheckpointService : IService, IFoundationSettings
    Remarks

    The checkpoint system treats snapshots as opaque black boxes. It does not interpret the content of serialized game state. Serialization format and persistence strategy are infrastructure concerns. Game-specific rules (e.g. "no saving during combat") belong outside this service.

    Methods

    Delete(CheckpointSlot)

    Deletes the checkpoint in the specified slot.

    Declaration
    void Delete(CheckpointSlot slot)
    Parameters
    Type Name Description
    CheckpointSlot slot

    The logical checkpoint slot.

    HasCheckpoint(CheckpointSlot)

    Checks whether a checkpoint exists in the specified slot.

    Declaration
    bool HasCheckpoint(CheckpointSlot slot)
    Parameters
    Type Name Description
    CheckpointSlot slot

    The logical checkpoint slot.

    Returns
    Type Description
    bool

    True if a checkpoint exists; otherwise false.

    QueryAvailable()

    Queries all available checkpoint metadata.

    Declaration
    IReadOnlyList<CheckpointMetadata> QueryAvailable()
    Returns
    Type Description
    IReadOnlyList<CheckpointMetadata>

    A read-only list of metadata for all stored checkpoints.

    Save(CheckpointSlot, byte[], CheckpointMetadata)

    Saves a checkpoint to the specified slot.

    Declaration
    CheckpointId Save(CheckpointSlot slot, byte[] data, CheckpointMetadata metadata)
    Parameters
    Type Name Description
    CheckpointSlot slot

    The logical checkpoint slot.

    byte[] data

    The raw serialized game state data.

    CheckpointMetadata metadata

    The metadata to associate with this checkpoint.

    Returns
    Type Description
    CheckpointId

    The identity of the saved checkpoint.

    TryLoad(CheckpointSlot, out CheckpointSnapshot)

    Loads the checkpoint from the specified slot.

    Declaration
    bool TryLoad(CheckpointSlot slot, out CheckpointSnapshot snapshot)
    Parameters
    Type Name Description
    CheckpointSlot slot

    The logical checkpoint slot.

    CheckpointSnapshot snapshot

    The loaded checkpoint snapshot, if found.

    Returns
    Type Description
    bool

    True if a checkpoint exists in the slot; otherwise false.

    TryLoad(CheckpointId, out CheckpointSnapshot)

    Loads a checkpoint by its identity.

    Declaration
    bool TryLoad(CheckpointId id, out CheckpointSnapshot snapshot)
    Parameters
    Type Name Description
    CheckpointId id

    The checkpoint identity.

    CheckpointSnapshot snapshot

    The loaded checkpoint snapshot, if found.

    Returns
    Type Description
    bool

    True if the checkpoint exists; otherwise false.

    In this article
    © 2026 Serenity. All Rights Reserved