Package com.fs.starfarer.api.impl
Class BaseSharedJSONFile
java.lang.Object
com.fs.starfarer.api.impl.BaseSharedJSONFile
- Direct Known Subclasses:
SharedUnlockData
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.
- Author:
- Alex
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
doesSetContain
(String key, String value) protected abstract String
void
boolean
optBoolean
(String key, boolean defaultValue) float
int
void
void
setBoolean
(String key, boolean value) void
void
void
void
-
Field Details
-
json
protected org.json.JSONObject json -
setCache
-
-
Constructor Details
-
BaseSharedJSONFile
public BaseSharedJSONFile()
-
-
Method Details
-
getFilename
-
loadIfNeeded
public void loadIfNeeded() -
saveIfNeeded
public void saveIfNeeded() -
getSet
-
doesSetContain
-
addToSet
-
optBoolean
-
setBoolean
-
optFloat
-
setFloat
-
optInt
-
setInt
-
optString
-
setString
-
unset
-