Class MemoryDataLayer
Straightforward synchronous data layer that keep data in memory for the session only.
Inherited Members
Namespace: UnityEngine.GameFoundation.DefaultLayers
Syntax
public class MemoryDataLayer : BaseMemoryDataLayer, IDataAccessLayer, ICatalogConfigurator, IInventoryDataLayer, IWalletDataLayer, ITransactionDataLayer, IRewardDataLayer
Constructors
MemoryDataLayer(GameFoundationData, CatalogAsset)
Create a data layer with the given catalog provider that will handle the given data for the current game session only.
Declaration
public MemoryDataLayer(GameFoundationData data, CatalogAsset database = null)
Parameters
Type | Name | Description |
---|---|---|
GameFoundationData | data | GameFoundation's serializable data. |
CatalogAsset | database | Provides definitions to the runtime Catalog. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | If the given data contains invalid null values. |
MemoryDataLayer(CatalogAsset)
Creates a data layer with no player data.
Declaration
public MemoryDataLayer(CatalogAsset database = null)
Parameters
Type | Name | Description |
---|---|---|
CatalogAsset | database | Provides definitions to the runtime Catalog. |
Methods
GetLayerData()
Gets all the data from Game Foundation (for persistence)
Declaration
public GameFoundationData GetLayerData()
Returns
Type | Description |
---|---|
GameFoundationData | The player's data. |
Initialize(Completer)
Initialize this data layer.
Declaration
public override void Initialize(Completer completer)
Parameters
Type | Name | Description |
---|---|---|
Completer | completer | When done, this completer is resolved or rejected. |