![]() |
Rigs of Rods 2026.01
Soft-body Physics Simulation
|
Binding of RoR::LocalStorage; A class that allows your script to store data persistently.
The data will be stored on the hard disk of the user. The data will stay available until the user clears his cache. Your data will be saved automatically if the object is destroyed or when you call the save() method. To get your data, you'll have to use the correct get function, as that function will have to convert the data from a string to the correct datatype.
Definition at line 19 of file LocalStorageClass.h.
Public Member Functions | |
| LocalStorage (string filename, const string &in sectionname="common", const string &in resource_group_name="Cache") | |
| string | get (string key) |
| string | getString (string key) |
| void | set (string key, const string value) |
| void | setString (string key, const string value) |
| float | getFloat (string key) |
| void | set (string key, float value) |
| void | setFloat (string key, float value) |
| vector3 | getVector3 (string key) |
| void | set (string key, const vector3 value) |
| void | setVector3 (string key, const vector3 value) |
| radian | getRadian (string key) |
| void | set (string key, const radian value) |
| void | setRadian (string key, const radian value) |
| degree | getDegree (string key) |
| void | set (string key, const degree value) |
| void | setDegree (string key, const degree value) |
| quaternion | getQuaternion (string key) |
| void | set (string key, const quaternion value) |
| void | setQuaternion (string key, const quaternion value) |
| bool | getBool (string key) |
| void | set (string key, const bool value) |
| void | setBool (string key, const bool value) |
| int | getInt (string key) |
| int | getInteger (string key) |
| void | set (string key, int) |
| void | setInt (string key, int) |
| void | setInteger (string key, int) |
| void | save () |
| bool | reload () |
| bool | exists (string key) const |
| void | delete (string key) |
| void | changeSection (const string section) |
| void Script2Game::LocalStorageClass::changeSection | ( | const string | section | ) |
Changes the default section.
| section | the new section. |
| void Script2Game::LocalStorageClass::delete | ( | string | key | ) |
| bool Script2Game::LocalStorageClass::exists | ( | string | key | ) | const |
| string Script2Game::LocalStorageClass::get | ( | string | key | ) |
A getter for string data.
| key | The key, associated with the data you want to get. You can use a point ('.') to use another section than the default, as specified when constructing the object. E.g.: string myValue = get("mySection.myKey"); will get the value associated with the key 'myKey' in section 'mySection'. |
| bool Script2Game::LocalStorageClass::getBool | ( | string | key | ) |
| degree Script2Game::LocalStorageClass::getDegree | ( | string | key | ) |
| float Script2Game::LocalStorageClass::getFloat | ( | string | key | ) |
| int Script2Game::LocalStorageClass::getInt | ( | string | key | ) |
| int Script2Game::LocalStorageClass::getInteger | ( | string | key | ) |
| quaternion Script2Game::LocalStorageClass::getQuaternion | ( | string | key | ) |
| radian Script2Game::LocalStorageClass::getRadian | ( | string | key | ) |
| string Script2Game::LocalStorageClass::getString | ( | string | key | ) |
| vector3 Script2Game::LocalStorageClass::getVector3 | ( | string | key | ) |
| Script2Game::LocalStorageClass::LocalStorage | ( | string | filename, |
| const string &in | sectionname = "common", |
||
| const string &in | resource_group_name = "Cache" |
||
| ) |
The constructor for the class.
This will return a reference to the newly created object.
| filename | The name of the file that should be used to save the data. |
| filename | The name of the resource group where the file should be created. |
| sectionname | Which section should be used by default. |
| bool Script2Game::LocalStorageClass::reload | ( | ) |
This reloads the data from the saved file, overwriting your changes.
| void Script2Game::LocalStorageClass::save | ( | ) |
This saves the data to a file.
The data will also be auto-saved when the object is destroyed.
| void Script2Game::LocalStorageClass::set | ( | string | key, |
| const bool | value | ||
| ) |
| void Script2Game::LocalStorageClass::set | ( | string | key, |
| const degree | value | ||
| ) |
| void Script2Game::LocalStorageClass::set | ( | string | key, |
| const quaternion | value | ||
| ) |
| void Script2Game::LocalStorageClass::set | ( | string | key, |
| const radian | value | ||
| ) |
| void Script2Game::LocalStorageClass::set | ( | string | key, |
| const string | value | ||
| ) |
| void Script2Game::LocalStorageClass::set | ( | string | key, |
| const vector3 | value | ||
| ) |
| void Script2Game::LocalStorageClass::set | ( | string | key, |
| float | value | ||
| ) |
| void Script2Game::LocalStorageClass::set | ( | string | key, |
| int | |||
| ) |
| void Script2Game::LocalStorageClass::setBool | ( | string | key, |
| const bool | value | ||
| ) |
| void Script2Game::LocalStorageClass::setDegree | ( | string | key, |
| const degree | value | ||
| ) |
| void Script2Game::LocalStorageClass::setFloat | ( | string | key, |
| float | value | ||
| ) |
| void Script2Game::LocalStorageClass::setInt | ( | string | key, |
| int | |||
| ) |
| void Script2Game::LocalStorageClass::setInteger | ( | string | key, |
| int | |||
| ) |
| void Script2Game::LocalStorageClass::setQuaternion | ( | string | key, |
| const quaternion | value | ||
| ) |
| void Script2Game::LocalStorageClass::setRadian | ( | string | key, |
| const radian | value | ||
| ) |
| void Script2Game::LocalStorageClass::setString | ( | string | key, |
| const string | value | ||
| ) |
| void Script2Game::LocalStorageClass::setVector3 | ( | string | key, |
| const vector3 | value | ||
| ) |