Class UnityGameSettingsMapper
Unity-specific mapper for game settings repository that handles value type conversion and service delegation.
Implements
Inherited Members
Namespace: Serenity.GameSettings.InterfaceAdapters.Repositories
Assembly: Serenity.UnityGlobal.InterfaceAdapters.dll
Syntax
public class UnityGameSettingsMapper : IGameSettingsRepository
Constructors
UnityGameSettingsMapper(IGameSettingsService)
Initializes a new Unity game settings mapper with the specified service.
Declaration
public UnityGameSettingsMapper(IGameSettingsService service)
Parameters
| Type | Name | Description |
|---|---|---|
| IGameSettingsService | service | The game settings service to use for value retrieval and storage. |
Methods
GetValue(GetGameSettingsValueInput)
Gets a game settings value by ID and converts it to the appropriate type.
Declaration
public GetGameSettingsValueOutput GetValue(GetGameSettingsValueInput input)
Parameters
| Type | Name | Description |
|---|---|---|
| GetGameSettingsValueInput | input | Input data containing the setting ID and expected value type. |
Returns
| Type | Description |
|---|---|
| GetGameSettingsValueOutput | The game setting value converted to string format with type information. |
SetValue(SetGameSettingsValueInput)
Sets a game settings value by ID after converting from string to the appropriate type.
Declaration
public void SetValue(SetGameSettingsValueInput input)
Parameters
| Type | Name | Description |
|---|---|---|
| SetGameSettingsValueInput | input | Input data containing the setting ID, value, and type information. |
Exceptions
| Type | Condition |
|---|---|
| NotImplementedException | Thrown when the specified value type is not supported. |