Otter
0.9.8.91
2d Game Development Framework based on SFML.Net
|
Class that is used for storing strings, ints, floats, or bools with keys of enum or string. The saver can output data in an semi-encrypted format, and also an editable config file format. More...
Public Types | |
enum | DataExportMode { Data, Config } |
The export modes for the data. More... | |
Public Member Functions | |
DataSaver (string defaultPath="") | |
Initializes a new instance of the DataSaver class. More... | |
bool | Verify (string stringData) |
Verifies the specified string data. Only applies to DataExportMode.Data. More... | |
void | ClearFile (string filename="") |
Deletes the exported file for this save data. More... | |
void | Clear () |
Clears the data. More... | |
bool | FileExists (string filename="") |
Check if an exported file exists for this data. More... | |
void | Import (string filename="", bool verify=true) |
Imports the data in the specified file. More... | |
void | Export (string filename="") |
Exports the data to the specified file. More... | |
float | GetFloat (string key) |
Gets a float from the data. More... | |
float | GetFloat (Enum key) |
Gets a float from the data. More... | |
float | GetFloatOrDefault (string key, float defaultIfNotFound=default(float)) |
Gets a float or a default float value. More... | |
float | GetFloatOrDefault (Enum key, float defaultIfNotFound=default(float)) |
Gets a float or a default float value. More... | |
int | GetInt (string key) |
Gets an int from the data. More... | |
int | GetInt (Enum key) |
Gets an int from the data. More... | |
int | GetIntOrDefault (string key, int defaultIfNotFound=default(int)) |
Gets an int or a default int value. More... | |
int | GetIntOrDefault (Enum key, int defaultIfNotFound=default(int)) |
Gets an int or a default int value. More... | |
string | GetString (string key) |
Gets a string from the data. More... | |
string | GetString (Enum key) |
Gets a string from the data. More... | |
string | GetStringOrDefault (string key, string defaultIfNotFound=default(string)) |
Gets a string or a default string value. More... | |
string | GetStringOrDefault (Enum key, string defaultIfNotFound=default(string)) |
Gets a string or a default string value. More... | |
bool | GetBool (string key) |
Gets a bool from the data. More... | |
bool | GetBool (Enum key) |
Gets a bool from the data. More... | |
bool | GetBoolOrDefault (string key, bool defaultIfNotFound=default(bool)) |
Gets a bool or a default bool value. More... | |
bool | GetBoolOrDefault (Enum key, bool defaultIfNotFound=default(bool)) |
Gets a bool or a default bool value. More... | |
void | SetData (string key, object obj) |
Sets the data. More... | |
void | SetData (Enum key, object obj) |
Sets the data. More... | |
Public Attributes | |
string | KeyDelim = "::OTTERK::" |
The string to use when delimiting key data in data exports. More... | |
string | ValueDelim = "::OTTERV::" |
The string to use when delimiting value data in data exports. More... | |
string | EncryptionSalt = "otter" |
The phrase to use as a salt when encrypting the data exports. More... | |
string | SaltGuide = "{S}{D}{S}" |
The guide to salt the data string. {S} is the salt, {D} is the data. It is recommended to change this from the default for your game, but only if you really care about hacking save data. More... | |
string | DefaultPath = "" |
The default path that the files will be imported from and exported to. More... | |
string | DefaultFilename = "data" |
The default file name that the data will export as. More... | |
DataExportMode | ExportMode = DataExportMode.Data |
The export mode for the data. Data: Semi-encrypted uneditable data. Config: Easy to hand edit unencrypted data. More... | |
Properties | |
string | this[string key] [get] |
Gets the string with the specified key. More... | |
string | this[Enum key] [get] |
Gets the string with the specified key. More... | |
Class that is used for storing strings, ints, floats, or bools with keys of enum or string. The saver can output data in an semi-encrypted format, and also an editable config file format.
The export modes for the data.
Otter.DataSaver.DataSaver | ( | string | defaultPath = "" | ) |
Initializes a new instance of the DataSaver class.
defaultPath | The default path. |
void Otter.DataSaver.Clear | ( | ) |
Clears the data.
void Otter.DataSaver.ClearFile | ( | string | filename = "" | ) |
Deletes the exported file for this save data.
filename | The filename to delete (usually you don't have to set this.) |
void Otter.DataSaver.Export | ( | string | filename = "" | ) |
Exports the data to the specified file.
filename | The filename. |
bool Otter.DataSaver.FileExists | ( | string | filename = "" | ) |
Check if an exported file exists for this data.
filename | The filename to check. |
bool Otter.DataSaver.GetBool | ( | string | key | ) |
Gets a bool from the data.
key | The key. |
bool Otter.DataSaver.GetBool | ( | Enum | key | ) |
Gets a bool from the data.
key | The key. |
bool Otter.DataSaver.GetBoolOrDefault | ( | string | key, |
bool | defaultIfNotFound = default(bool) |
||
) |
Gets a bool or a default bool value.
key | The key. |
defaultIfNotFound | The default if not found. |
bool Otter.DataSaver.GetBoolOrDefault | ( | Enum | key, |
bool | defaultIfNotFound = default(bool) |
||
) |
Gets a bool or a default bool value.
key | The key. |
defaultIfNotFound | The default if not found. |
float Otter.DataSaver.GetFloat | ( | string | key | ) |
Gets a float from the data.
key | The key. |
float Otter.DataSaver.GetFloat | ( | Enum | key | ) |
Gets a float from the data.
key | The key. |
float Otter.DataSaver.GetFloatOrDefault | ( | string | key, |
float | defaultIfNotFound = default(float) |
||
) |
Gets a float or a default float value.
key | The key. |
defaultIfNotFound | The default if not found. |
float Otter.DataSaver.GetFloatOrDefault | ( | Enum | key, |
float | defaultIfNotFound = default(float) |
||
) |
Gets a float or a default float value.
key | The key. |
defaultIfNotFound | The default if not found. |
int Otter.DataSaver.GetInt | ( | string | key | ) |
Gets an int from the data.
key | The key. |
int Otter.DataSaver.GetInt | ( | Enum | key | ) |
Gets an int from the data.
key | The key. |
int Otter.DataSaver.GetIntOrDefault | ( | string | key, |
int | defaultIfNotFound = default(int) |
||
) |
Gets an int or a default int value.
key | The key. |
defaultIfNotFound | The default if not found. |
int Otter.DataSaver.GetIntOrDefault | ( | Enum | key, |
int | defaultIfNotFound = default(int) |
||
) |
Gets an int or a default int value.
key | The key. |
defaultIfNotFound | The default if not found. |
string Otter.DataSaver.GetString | ( | string | key | ) |
Gets a string from the data.
key | The key. |
string Otter.DataSaver.GetString | ( | Enum | key | ) |
Gets a string from the data.
key | The key. |
string Otter.DataSaver.GetStringOrDefault | ( | string | key, |
string | defaultIfNotFound = default(string) |
||
) |
Gets a string or a default string value.
key | The key. |
defaultIfNotFound | The default if not found. |
string Otter.DataSaver.GetStringOrDefault | ( | Enum | key, |
string | defaultIfNotFound = default(string) |
||
) |
Gets a string or a default string value.
key | The key. |
defaultIfNotFound | The default if not found. |
void Otter.DataSaver.Import | ( | string | filename = "" , |
bool | verify = true |
||
) |
Imports the data in the specified file.
filename | The filename. |
verify | if set to true verify the data before importing. |
void Otter.DataSaver.SetData | ( | string | key, |
object | obj | ||
) |
Sets the data.
key | The key. |
obj | The object. |
void Otter.DataSaver.SetData | ( | Enum | key, |
object | obj | ||
) |
Sets the data.
key | The key. |
obj | The object. |
bool Otter.DataSaver.Verify | ( | string | stringData | ) |
Verifies the specified string data. Only applies to DataExportMode.Data.
stringData | The string data. |
string Otter.DataSaver.DefaultFilename = "data" |
The default file name that the data will export as.
string Otter.DataSaver.DefaultPath = "" |
The default path that the files will be imported from and exported to.
string Otter.DataSaver.EncryptionSalt = "otter" |
The phrase to use as a salt when encrypting the data exports.
DataExportMode Otter.DataSaver.ExportMode = DataExportMode.Data |
The export mode for the data. Data: Semi-encrypted uneditable data. Config: Easy to hand edit unencrypted data.
string Otter.DataSaver.KeyDelim = "::OTTERK::" |
The string to use when delimiting key data in data exports.
string Otter.DataSaver.SaltGuide = "{S}{D}{S}" |
The guide to salt the data string. {S} is the salt, {D} is the data. It is recommended to change this from the default for your game, but only if you really care about hacking save data.
string Otter.DataSaver.ValueDelim = "::OTTERV::" |
The string to use when delimiting value data in data exports.
|
get |
Gets the string with the specified key.
key | The key. |
|
get |
Gets the string with the specified key.
key | The key. |