public class ResourceData<T> extends java.lang.Object implements Json.Serializable
ResourceData.Configurable interface and obtain a ResourceData.SaveData object to store every required
asset or information which will be used during the loading phase. The passed in AssetManager is generally used to find
the asset file name for a given resource of a given type. The class can also store global configurations, this is useful when
dealing with objects which should be allocated once (i.e singleton). The deserialization process must happen in the same order
of serialization, because the per object ResourceData.SaveData blocks are stored as an Array within the ResourceData
, while the global ResourceData.SaveData instances can be accessed in any order because require a unique String and are
stored in an ObjectMap.| Modifier and Type | Class and Description |
|---|---|
static class |
ResourceData.AssetData<T>
This class contains all the information related to a given asset
|
static interface |
ResourceData.Configurable<T>
This interface must be implemented by any class requiring additional assets to be loaded/saved
|
static class |
ResourceData.SaveData
Contains all the saved data.
|
| Constructor and Description |
|---|
ResourceData() |
ResourceData(T resource) |
| Modifier and Type | Method and Description |
|---|---|
ResourceData.SaveData |
createSaveData()
Creates and adds a new SaveData object to the save data list
|
ResourceData.SaveData |
createSaveData(java.lang.String key)
Creates and adds a new and unique SaveData object to the save data map
|
Array<AssetDescriptor> |
getAssetDescriptors() |
Array<ResourceData.AssetData> |
getAssets() |
ResourceData.SaveData |
getSaveData() |
ResourceData.SaveData |
getSaveData(java.lang.String key) |
void |
read(Json json,
JsonValue jsonData) |
void |
write(Json json) |
public T resource
public ResourceData()
public ResourceData(T resource)
public Array<AssetDescriptor> getAssetDescriptors()
public Array<ResourceData.AssetData> getAssets()
public ResourceData.SaveData createSaveData()
public ResourceData.SaveData createSaveData(java.lang.String key)
public ResourceData.SaveData getSaveData()
public ResourceData.SaveData getSaveData(java.lang.String key)
public void write(Json json)
write in interface Json.Serializablepublic void read(Json json, JsonValue jsonData)
read in interface Json.Serializable