Class ResourceData<T>

  • All Implemented Interfaces:
    Json.Serializable

    public class ResourceData<T>
    extends java.lang.Object
    implements Json.Serializable
    This class handles the assets and configurations required by a given resource when de/serialized. It's handy when a given object or one of its members requires some assets to be loaded to work properly after being deserialized. To save the assets, the object should implement the 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.