logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class GameProgressBackendFactory

    Resolves the IGameProgressStore backend selected by the shared, consumer-agnostic UnityStructuredBackendDefinition asset assigned to UnityGameProgressSettings.Backend, dispatching on the asset's concrete type — checking ICustomStructuredBackendDefinition FIRST so a project-defined store wins — then wraps the resolved IStructuredStore once in a StructuredStoreGameProgressAdapter. Store construction lives in the shared StructuredBackendStores helper, parameterized by this factory's StructuredBackendConsumerProfile; this class keeps only game progress's own dispatch, fallback target, adapter wrap, and table resolution.

    Inheritance
    object
    GameProgressBackendFactory
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Serenity.GameProgress.Installation.Installers
    Assembly: Serenity.UnityGameProgress.Installation.dll
    Syntax
    public static class GameProgressBackendFactory
    Remarks

    A null backend — and every misconfigured, driver-gated, or failed one — falls back to the device's PlayerPrefs key-value store (game progress's zero-config default) with a warning. PlayerPrefs and LocalFile are always installed; Postgres/MySql/Mongo/Sqlite additionally require their respective SERENITY_STRUCTURED_POSTGRES/SERENITY_STRUCTURED_MYSQL/ SERENITY_STRUCTURED_MONGO/SERENITY_STRUCTURED_SQLITE scripting define and driver. This factory never throws, matching the framework's never-throw-in-runtime philosophy.

    Methods

    Create(UnityStructuredBackendDefinition, StoreTable, ILogService)

    Resolves and constructs the configured game-progress store, dispatching on the backend asset's concrete type.

    Declaration
    public static IGameProgressStore Create(UnityStructuredBackendDefinition backendDefinition, StoreTable table, ILogService logService)
    Parameters
    Type Name Description
    UnityStructuredBackendDefinition backendDefinition

    The backend selection, or null to use the PlayerPrefs key-value store.

    StoreTable table

    The table or collection progress persists through, from ResolveTable(string).

    ILogService logService

    Logging service used to report an unavailable backend or configuration fallback. May be null.

    Returns
    Type Description
    IGameProgressStore

    The resolved IGameProgressStore.

    ResolveTable(string)

    Resolves the game-progress table from the settings-configured name, or the default when blank.

    Declaration
    public static StoreTable ResolveTable(string tableOrCollectionName)
    Parameters
    Type Name Description
    string tableOrCollectionName

    The configured table or collection name, or null/blank for the default.

    Returns
    Type Description
    StoreTable
    In this article
    © 2026 Serenity. All Rights Reserved