Kanda Foundation 0.2.0
Loading...
Searching...
No Matches
UserSettingsService Class Reference

More...

+ Inheritance diagram for UserSettingsService:

Public Member Functions

 UserSettingsService (IPlayerPrefs playerPrefs, string encryptionKey)
 
bool HasKey (string key)
 If true, a setting with this key exists in user settings.
Parameters
keyThe key to check.

 
void DeleteKey (string key)
 Removes a user setting by key.
Parameters
keyThe key of the user setting to remove.

 
void ForceSave ()
 Forces user settings to be committed to disk. This should happen automatically when application exits, so use only if it is critical that a setting gets committed in case of application crash.
 
void SetInt (string key, int value)
 Commits an integer to user settings.
 
void SetFloat (string key, float value)
 Commits a float to user settings.
 
void SetString (string key, string value)
 Commits a string to user settings.
 
void SetStringWithEncryption (string key, string value)
 Encrypts and commits a string to user settings.
 
void SetObject< T > (string key, T value)
 Commits an object to user settings by serializing it as a JSON string.
 
void SetObjectWithEncryption< T > (string key, T value)
 Encrypts and commits an object to user settings by serializing it as a JSON string.
 
int GetInt (string key)
 Tries to get an int from user settings.
Exceptions
ArgumentExceptionThrown if the key does not exist.

 
float GetFloat (string key)
 Tries to get a float from user settings.
Exceptions
ArgumentExceptionThrown if the key does not exist.

 
string GetString (string key)
 Tries to get a string from user settings.
Exceptions
ArgumentExceptionThrown if the key does not exist.

 
string GetEncryptedString (string key)
 Tries to get and decrypt a string from user settings.
Exceptions
ArgumentExceptionThrown if the key does not exist.

 
GetObject< T > (string key)
 Tries to get an object from user settings.
Exceptions
ArgumentExceptionThrown if the key does not exist.

 
GetEncryptedObject< T > (string key)
 Tries to get and decrypt an object from user settings.
Exceptions
ArgumentExceptionThrown if the key does not exist.

 

Detailed Description

Member Function Documentation

◆ DeleteKey()

void DeleteKey ( string key)
inline

Removes a user setting by key.

Parameters
keyThe key of the user setting to remove.

Implements IUserSettingsService.

◆ ForceSave()

void ForceSave ( )
inline

Forces user settings to be committed to disk. This should happen automatically when application exits, so use only if it is critical that a setting gets committed in case of application crash.

Implements IUserSettingsService.

◆ GetEncryptedObject< T >()

T GetEncryptedObject< T > ( string key)
inline

Tries to get and decrypt an object from user settings.

Exceptions
ArgumentExceptionThrown if the key does not exist.

Implements IUserSettingsService.

◆ GetEncryptedString()

string GetEncryptedString ( string key)
inline

Tries to get and decrypt a string from user settings.

Exceptions
ArgumentExceptionThrown if the key does not exist.

Implements IUserSettingsService.

◆ GetFloat()

float GetFloat ( string key)
inline

Tries to get a float from user settings.

Exceptions
ArgumentExceptionThrown if the key does not exist.

Implements IUserSettingsService.

◆ GetInt()

int GetInt ( string key)
inline

Tries to get an int from user settings.

Exceptions
ArgumentExceptionThrown if the key does not exist.

Implements IUserSettingsService.

◆ GetObject< T >()

T GetObject< T > ( string key)
inline

Tries to get an object from user settings.

Exceptions
ArgumentExceptionThrown if the key does not exist.

Implements IUserSettingsService.

◆ GetString()

string GetString ( string key)
inline

Tries to get a string from user settings.

Exceptions
ArgumentExceptionThrown if the key does not exist.

Implements IUserSettingsService.

◆ HasKey()

bool HasKey ( string key)
inline

If true, a setting with this key exists in user settings.

Parameters
keyThe key to check.

Implements IUserSettingsService.

◆ SetFloat()

void SetFloat ( string key,
float value )
inline

Commits a float to user settings.

Implements IUserSettingsService.

◆ SetInt()

void SetInt ( string key,
int value )
inline

Commits an integer to user settings.

Implements IUserSettingsService.

◆ SetObject< T >()

void SetObject< T > ( string key,
T value )
inline

Commits an object to user settings by serializing it as a JSON string.

Implements IUserSettingsService.

◆ SetObjectWithEncryption< T >()

void SetObjectWithEncryption< T > ( string key,
T value )
inline

Encrypts and commits an object to user settings by serializing it as a JSON string.

Implements IUserSettingsService.

◆ SetString()

void SetString ( string key,
string value )
inline

Commits a string to user settings.

Implements IUserSettingsService.

◆ SetStringWithEncryption()

void SetStringWithEncryption ( string key,
string value )
inline

Encrypts and commits a string to user settings.

Implements IUserSettingsService.


The documentation for this class was generated from the following file: