Class AssetStore
Inheritance
java.lang.Object
AssetStore
Syntax
Constructors
AssetStore()
Declaration
Fields
assets
The type of asset mapped to the list of suffix' mapped to their associate reference counted containers.
Declaration
public Map<Class, HashMap<String, AssetContainer>> assets
Field Value
assetTypes
Declaration
public HashMap<String, Class> assetTypes
Field Value
Type |
Description |
HashMap<String, Class> |
|
Methods
addAsset(Class type, String name, T asset)
This adds the asset to the static list. It also protects from duplicates since there can be only one type. And when loading ModelScenes There can be many assets there.
Declaration
public synchronized<T> void addAsset(Class type, String name, T asset)
Parameters
Type |
Name |
Description |
Class |
type |
|
String |
name |
|
T |
asset |
|
Returns
Type |
Description |
synchronized<T> void |
|
contains(Class type, String assetName)
Declaration
public boolean contains(Class type, String assetName)
Parameters
Type |
Name |
Description |
Class |
type |
|
String |
assetName |
|
Returns
contains(String assetName)
Declaration
public synchronized boolean contains(String assetName)
Parameters
Type |
Name |
Description |
String |
assetName |
|
Returns
Type |
Description |
synchronized boolean |
|
get(Class type)
Declaration
public synchronized HashMap<String, AssetContainer> get(Class type)
Parameters
Type |
Name |
Description |
Class |
type |
|
Returns
get(Class<T> type, String assetName)
Gets the asset from the store using the name, either the file's name or the asset name defined in the file. i.e. Model uses the ModelSceneLoader wich loads all assets from the file which there can be multiple of. So the loader assigns the names as keys to find them.
Declaration
public synchronized<T> T get(Class<T> type, String assetName)
Parameters
Type |
Name |
Description |
Class<T> |
type |
|
String |
assetName |
|
Returns
Type |
Description |
synchronized<T> T |
|
get(String fileName)
Declaration
public synchronized<T> T get(String fileName)
Parameters
Type |
Name |
Description |
String |
fileName |
|
Returns
Type |
Description |
synchronized<T> T |
|
getAll(Class<T> type)
Declaration
public synchronized<T> ArrayList<T> getAll(Class<T> type)
Parameters
Type |
Name |
Description |
Class<T> |
type |
|
Returns
Type |
Description |
synchronized<T> ArrayList<T> |
|
getAssetTypes()
Declaration
public HashMap<String, Class> getAssetTypes()
Returns
Type |
Description |
HashMap<String, Class> |
|
getContainer(Class<T> type, String assetName)
Declaration
public <T> AssetContainer getContainer(Class<T> type, String assetName)
Parameters
Type |
Name |
Description |
Class<T> |
type |
|
String |
assetName |
|
Returns
getType(String fileName)
Declaration
public synchronized<T> Class<T> getType(String fileName)
Parameters
Type |
Name |
Description |
String |
fileName |
|
Returns
Type |
Description |
synchronized<T> Class<T> |
|
removeAsset(Class type, String assetName)
Declaration
public synchronized<T> void removeAsset(Class type, String assetName)
Parameters
Type |
Name |
Description |
Class |
type |
|
String |
assetName |
|
Returns
Type |
Description |
synchronized<T> void |
|
removeAsset(String assetName)
Declaration
public synchronized<T> void removeAsset(String assetName)
Parameters
Type |
Name |
Description |
String |
assetName |
|
Returns
Type |
Description |
synchronized<T> void |
|