Package com.dragonboatrace.tools
Class Prefs.Restore
- java.lang.Object
-
- com.dragonboatrace.tools.Prefs.Restore
-
- Enclosing class:
- Prefs
public static class Prefs.Restore extends java.lang.Object
Static class sued to load data.
-
-
Constructor Summary
Constructors Constructor Description Restore()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
close()
Called after all other restore methods.static java.lang.Float[]
getArray(java.lang.String key)
Restore a Float array.static BoatType
getBoatType(java.lang.String key)
Restore BoatTypestatic float
getFloat(java.lang.String key)
Restore a floatstatic int
getInteger(java.lang.String key)
Restore an intstatic com.badlogic.gdx.math.Vector2
getVector2(java.lang.String key)
Restore a Vector2.static void
open()
Called before any other Restore methods.
-
-
-
Method Detail
-
open
public static void open() throws Prefs.SaveDoesNotExist
Called before any other Restore methods.- Throws:
Prefs.SaveDoesNotExist
- if save file does not exist
-
close
public static void close()
Called after all other restore methods. Does nothing.
-
getInteger
public static int getInteger(java.lang.String key)
Restore an int- Parameters:
key
- key the int is stored under- Returns:
- the restored int
-
getFloat
public static float getFloat(java.lang.String key)
Restore a float- Parameters:
key
- key the float is stored under- Returns:
- the restored float
-
getArray
public static java.lang.Float[] getArray(java.lang.String key)
Restore a Float array. Deserialized from JSON.- Parameters:
key
- key the array is stored under.- Returns:
- the restored array.
-
getVector2
public static com.badlogic.gdx.math.Vector2 getVector2(java.lang.String key)
Restore a Vector2.- Parameters:
key
- key the vector is stored under.- Returns:
- the restored vector.
-
getBoatType
public static BoatType getBoatType(java.lang.String key)
Restore BoatType- Parameters:
key
- key the BoatType is stored under- Returns:
- the restored BoatType
-
-