|
Starsector API
|
Public Member Functions | |
| void | loadIfNeeded () |
| void | saveIfNeeded () |
| Set< String > | getSet (String key) |
| boolean | doesSetContain (String key, String value) |
| boolean | addToSet (String key, String value) |
| boolean | optBoolean (String key, boolean defaultValue) |
| void | setBoolean (String key, boolean value) |
| float | optFloat (String key, float defaultValue) |
| void | setFloat (String key, float value) |
| int | optInt (String key, int defaultValue) |
| void | setInt (String key, int value) |
| String | optString (String key, String defaultValue) |
| void | setString (String key, String value) |
| void | unset (String key) |
Protected Member Functions | |
| abstract String | getFilename () |
Protected Attributes | |
| JSONObject | json = new JSONObject() |
| Map< String, Set< String > > | setCache = new HashMap<>() |
Base class. Extending classes are for relatively small amounts of data meant to be shared across different saves.
The amount of data stored here should be small and bounded (i.e. not growing indefinitely).
Code using this should assume the data stored here may be lost (e.g. due to the common folder being deleted) and handle this/recover gracefully.
Definition at line 30 of file BaseSharedJSONFile.java.
| boolean com.fs.starfarer.api.impl.BaseSharedJSONFile.addToSet | ( | String | key, |
| String | value ) |
Definition at line 84 of file BaseSharedJSONFile.java.
| boolean com.fs.starfarer.api.impl.BaseSharedJSONFile.doesSetContain | ( | String | key, |
| String | value ) |
Definition at line 79 of file BaseSharedJSONFile.java.
|
abstractprotected |
Reimplemented in com.fs.starfarer.api.impl.SharedUnlockData.
| Set< String > com.fs.starfarer.api.impl.BaseSharedJSONFile.getSet | ( | String | key | ) |
Definition at line 62 of file BaseSharedJSONFile.java.
| void com.fs.starfarer.api.impl.BaseSharedJSONFile.loadIfNeeded | ( | ) |
Definition at line 35 of file BaseSharedJSONFile.java.
| boolean com.fs.starfarer.api.impl.BaseSharedJSONFile.optBoolean | ( | String | key, |
| boolean | defaultValue ) |
Definition at line 112 of file BaseSharedJSONFile.java.
| float com.fs.starfarer.api.impl.BaseSharedJSONFile.optFloat | ( | String | key, |
| float | defaultValue ) |
Definition at line 123 of file BaseSharedJSONFile.java.
| int com.fs.starfarer.api.impl.BaseSharedJSONFile.optInt | ( | String | key, |
| int | defaultValue ) |
Definition at line 134 of file BaseSharedJSONFile.java.
| String com.fs.starfarer.api.impl.BaseSharedJSONFile.optString | ( | String | key, |
| String | defaultValue ) |
Definition at line 145 of file BaseSharedJSONFile.java.
| void com.fs.starfarer.api.impl.BaseSharedJSONFile.saveIfNeeded | ( | ) |
Definition at line 47 of file BaseSharedJSONFile.java.
| void com.fs.starfarer.api.impl.BaseSharedJSONFile.setBoolean | ( | String | key, |
| boolean | value ) |
Definition at line 115 of file BaseSharedJSONFile.java.
| void com.fs.starfarer.api.impl.BaseSharedJSONFile.setFloat | ( | String | key, |
| float | value ) |
Definition at line 126 of file BaseSharedJSONFile.java.
| void com.fs.starfarer.api.impl.BaseSharedJSONFile.setInt | ( | String | key, |
| int | value ) |
Definition at line 137 of file BaseSharedJSONFile.java.
| void com.fs.starfarer.api.impl.BaseSharedJSONFile.setString | ( | String | key, |
| String | value ) |
Definition at line 148 of file BaseSharedJSONFile.java.
| void com.fs.starfarer.api.impl.BaseSharedJSONFile.unset | ( | String | key | ) |
Definition at line 156 of file BaseSharedJSONFile.java.
|
protected |
Definition at line 33 of file BaseSharedJSONFile.java.
|
protected |
Definition at line 60 of file BaseSharedJSONFile.java.