vooga.engine.resource.modules
Class ResourceModule
java.lang.Object
vooga.engine.resource.modules.ResourceModule
- Direct Known Subclasses:
- DoubleModule, ImageModule, IntegerModule, SoundModule, StringModule
public abstract class ResourceModule
- extends java.lang.Object
ResourceModules specify how to parse different types
of resources from an XML file, store the resources,
and retrieve the resources using a key. The infrastructure
for using ResourceModules are in place, but the problem
of returning resources of different classes using some
common method in the Resources class is unsolved.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ResourceModule
public ResourceModule()
setGame
public void setGame(Game game)
getGame
public Game getGame()
setDefaultPath
public void setDefaultPath(java.lang.String defaultFilePath)
getDefaultPath
public java.lang.String getDefaultPath()
loadElements
public abstract void loadElements(java.util.Collection<org.w3c.dom.Element> elements)
- Adds Elements to the resource map. Presumably, these elements
are part of a Document from parsing an XML file using the
Document Object Model
- Parameters:
elements
- Elements of the parsed XML document to be added
clearElements
public abstract void clearElements()
- Clears the current resource map. Resource maps should be cleared
when they are full of currently unneeded resources and the game
is starting to use too much memory.