logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Interface IGameSettingsService

    Service interface for managing game settings, including retrieval, modification, persistence, and loading of settings.

    Inherited Members
    IService.LogService
    Namespace: Serenity.GameSettings.Application.Interfaces
    Assembly: Serenity.Global.Application.dll
    Syntax
    public interface IGameSettingsService : IService, IFoundationSettings

    Methods

    GetBoolValue(GameSettingsGetBoolValueInput)

    Retrieves the boolean value of a specific game setting.

    Declaration
    GameSettingsGetBoolValueOutput GetBoolValue(GameSettingsGetBoolValueInput input)
    Parameters
    Type Name Description
    GameSettingsGetBoolValueInput input

    The input DTO containing the game setting ID.

    Returns
    Type Description
    GameSettingsGetBoolValueOutput

    The output DTO containing the boolean value of the game setting.

    GetFloatValue(GameSettingsGetFloatValueInput)

    Retrieves the float value of a specific game setting.

    Declaration
    GameSettingsGetFloatValueOutput GetFloatValue(GameSettingsGetFloatValueInput input)
    Parameters
    Type Name Description
    GameSettingsGetFloatValueInput input

    The input DTO containing the game setting ID.

    Returns
    Type Description
    GameSettingsGetFloatValueOutput

    The output DTO containing the float value of the game setting.

    GetGameSettings()

    Retrieves all game settings.

    Declaration
    Dictionary<string, GameSettingsEntity> GetGameSettings()
    Returns
    Type Description
    Dictionary<string, GameSettingsEntity>

    A dictionary of all game settings.

    GetGameSettings(string)

    Retrieves a specific game setting by its unique identifier.

    Declaration
    GameSettingsEntity GetGameSettings(string id)
    Parameters
    Type Name Description
    string id

    The unique identifier of the game setting.

    Returns
    Type Description
    GameSettingsEntity

    The game setting associated with the specified identifier.

    GetIntValue(GameSettingsGetIntValueInput)

    Retrieves the integer value of a specific game setting.

    Declaration
    GameSettingsGetIntValueOutput GetIntValue(GameSettingsGetIntValueInput input)
    Parameters
    Type Name Description
    GameSettingsGetIntValueInput input

    The input DTO containing the game setting ID.

    Returns
    Type Description
    GameSettingsGetIntValueOutput

    The output DTO containing the integer value of the game setting.

    GetStringValue(GameSettingsGetStringValueInput)

    Retrieves the string value of a specific game setting.

    Declaration
    GameSettingsGetStringValueOutput GetStringValue(GameSettingsGetStringValueInput input)
    Parameters
    Type Name Description
    GameSettingsGetStringValueInput input

    The input DTO containing the game setting ID.

    Returns
    Type Description
    GameSettingsGetStringValueOutput

    The output DTO containing the string value of the game setting.

    HasPersistedGameSettings()

    Checks synchronously whether persisted game settings exist on disk.
    Used to determine if this is a first-time launch (no saved settings) vs a returning user (has saved settings).

    Declaration
    bool HasPersistedGameSettings()
    Returns
    Type Description
    bool

    True if a saved settings file exists on disk, false otherwise.

    Initialize(ILogService, PersistenceUseCases, IPathService, string)

    Initializes the game settings service with the necessary dependencies.

    Declaration
    void Initialize(ILogService logService, PersistenceUseCases persistenceUseCases, IPathService pathService, string persistedFileName = null)
    Parameters
    Type Name Description
    ILogService logService

    The logging service for logging information and errors.

    PersistenceUseCases persistenceUseCases

    The persistence use cases for saving and loading settings.

    IPathService pathService

    The path service for managing file paths.

    string persistedFileName

    The filename used for persisted game settings. Uses DefaultPersistedFileName when null.

    LoadPersistedGameSettings()

    Loads the persisted game settings.

    Declaration
    void LoadPersistedGameSettings()

    LoadPersistedGameSettingsSync()

    Loads persisted game settings synchronously, blocking until complete.

    Declaration
    void LoadPersistedGameSettingsSync()

    PersistGameSettings()

    Persists the current game settings.

    Declaration
    void PersistGameSettings()

    SetBoolValue(GameSettingsSetBoolValueInput)

    Sets the boolean value of a specific game setting.

    Declaration
    void SetBoolValue(GameSettingsSetBoolValueInput input)
    Parameters
    Type Name Description
    GameSettingsSetBoolValueInput input

    The input DTO containing the game setting ID and the new boolean value.

    SetFloatValue(GameSettingsSetFloatValueInput)

    Sets the float value of a specific game setting.

    Declaration
    void SetFloatValue(GameSettingsSetFloatValueInput input)
    Parameters
    Type Name Description
    GameSettingsSetFloatValueInput input

    The input DTO containing the game setting ID and the new float value.

    SetGameSettings(GameSettingsEntity)

    Sets a specific game setting.

    Declaration
    void SetGameSettings(GameSettingsEntity gameSettings)
    Parameters
    Type Name Description
    GameSettingsEntity gameSettings

    The game setting to set.

    SetGameSettings(Dictionary<string, GameSettingsEntity>)

    Sets the game settings using a dictionary of game settings.

    Declaration
    void SetGameSettings(Dictionary<string, GameSettingsEntity> gameSettings)
    Parameters
    Type Name Description
    Dictionary<string, GameSettingsEntity> gameSettings

    A dictionary of game settings to set.

    SetIntValue(GameSettingsSetIntValueInput)

    Sets the integer value of a specific game setting.

    Declaration
    void SetIntValue(GameSettingsSetIntValueInput input)
    Parameters
    Type Name Description
    GameSettingsSetIntValueInput input

    The input DTO containing the game setting ID and the new integer value.

    SetStringValue(GameSettingsSetStringValueInput)

    Sets the string value of a specific game setting.

    Declaration
    void SetStringValue(GameSettingsSetStringValueInput input)
    Parameters
    Type Name Description
    GameSettingsSetStringValueInput input

    The input DTO containing the game setting ID and the new string value.

    In this article
    © 2026 Serenity. All Rights Reserved