vooga.engine.resource.modules
Class ResourceModule

java.lang.Object
  extended by 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.


Constructor Summary
ResourceModule()
           
 
Method Summary
abstract  void clearElements()
          Clears the current resource map.
 java.lang.String getDefaultPath()
           
 Game getGame()
           
abstract  void loadElements(java.util.Collection<org.w3c.dom.Element> elements)
          Adds Elements to the resource map.
 void setDefaultPath(java.lang.String defaultFilePath)
           
 void setGame(Game game)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceModule

public ResourceModule()
Method Detail

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.