SetDataPersistenceConfig
DataPersistenceBuilder SetDataPersistenceConfig(DataPersistenceConfig config)
Purpose: Sets the configuration data for the data persistence system, allowing the builder to configure how data should be handled (including encryption, compression, etc.) based on the provided configuration.
Parameters:
dataPersistenceConfig
: An instance of theDataPersistenceConfig
class that contains all the settings and preferences for configuring the data persistence system, such as encryption and compression options.
Return Value: Returns the DataPersistenceBuilder
instance to allow method chaining.
public void ConfigureDataPersistence()
{
AESCryptographyConfig aesConfig =
ScriptableObject.CreateInstance<AESCryptographyConfig>();
DataPersistenceConfig config =
ScriptableObject.CreateInstance<DataPersistenceConfig>();
config.encryption = true;
config.compression = true;
config.aesCryptographyConfig = aesConfig;
DataPersistenceBuilder builder = new DataPersistenceBuilder();
builder.SetDataPersistenceConfig(config);
}
This method sets up the configuration that guides the builder in creating and setting up the DataPersistenceService
. The configuration specifies important features such as whether encryption and compression should be enabled, as well as the details required for those features (like AES configuration for encryption).
Last updated