|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.triangularpixels.rebirth.resources.ResourcePool
public class ResourcePool
A pool of resource objects. Parses and creates resources from xml as well as managing their lifetimes. Resources may be loaded either immediately or in a background thread. Remember to call update() at least once a frame to keep things ticking over, and call destroy() when you're finished with it.
| Constructor Summary | |
|---|---|
ResourcePool(ResourceIO io,
FileMonitor monitor,
ResourceParser parser)
|
|
| Method Summary | ||
|---|---|---|
boolean |
areAllCreated()
|
|
void |
backgroundParse(String resourcePath)
Starts a background parse of the specified resource file. |
|
|
forceCreate(Class<T> type,
String resourceName)
|
|
boolean |
isIdle()
Returns true if no background parsing is taking place. |
|
boolean |
isInCreateQueue(ResourceHandle<? extends Resource> handle)
|
|
void |
parse(String resourcePath)
Opens the file specified and parses the contents. |
|
|
peek(Class<T> type,
String resourceName)
|
|
void |
processCreateQueue()
|
|
|
requestCreate(Class<T> type,
String resourceName)
Adds a resource onto the create queue so that it will be fully created in a background thread. |
|
void |
requestCreateAll()
|
|
void |
update()
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ResourcePool(ResourceIO io,
FileMonitor monitor,
ResourceParser parser)
| Method Detail |
|---|
public void parse(String resourcePath)
public void backgroundParse(String resourcePath)
resourcePath - public boolean isIdle()
public <T extends Resource> ResourceHandle<T> peek(Class<T> type,
String resourceName)
public <T extends Resource> ResourceHandle<T> forceCreate(Class<T> type,
String resourceName)
public <T extends Resource> ResourceHandle<T> requestCreate(Class<T> type,
String resourceName)
T - type - the type of the resource to createresourceName - the name of the resource
public void requestCreateAll()
public boolean areAllCreated()
public boolean isInCreateQueue(ResourceHandle<? extends Resource> handle)
public void processCreateQueue()
public void update()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||