logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Interface IScoreRepository

    Application port for persisting and retrieving score records.

    Namespace: Serenity.Score.Application.Interfaces.Repositories
    Assembly: Serenity.Score.Application.dll
    Syntax
    public interface IScoreRepository
    Remarks

    Implementations decide how and where score data is stored (in-memory, file system, cloud, etc.). The business layer depends on this abstraction, never on a concrete store.

    Methods

    Clear()

    Deletes all persisted score records.

    Declaration
    void Clear()

    LoadAll()

    Loads all persisted score records.

    Declaration
    ScoreRecord[] LoadAll()
    Returns
    Type Description
    ScoreRecord[]

    An array of all stored records. May be empty.

    Save(ScoreSnapshot)

    Saves a score snapshot as a record.

    Declaration
    void Save(ScoreSnapshot snapshot)
    Parameters
    Type Name Description
    ScoreSnapshot snapshot

    The score snapshot to persist.

    TryLoadLatest(out ScoreRecord)

    Loads the most recent score record, if any.

    Declaration
    bool TryLoadLatest(out ScoreRecord record)
    Parameters
    Type Name Description
    ScoreRecord record

    The loaded record, or default if none exists.

    Returns
    Type Description
    bool

    true if a record was found; otherwise false.

    In this article
    © 2026 Serenity. All Rights Reserved