vooga.widget.levelparse
Class ModularLevelParser
java.lang.Object
vooga.engine.factory.LevelParser
vooga.widget.levelparse.ModularLevelParser
- All Implemented Interfaces:
- LevelFactory
public class ModularLevelParser
- extends LevelParser
Allows the creation of modules which describe how to
parse any kind of BetterSprite. Currently only added a
modular parsing structure to the parsing of BetterSprites
from an XML file. It needs a moduleMapPathKey which is a
the key to look up a String in Resources. That string is the
file path of a properties file which maps the module attribute
of the BetterSprite Element to a SpriteModule which will be used
to parse the BetterSprite. The module is created by reflection
using the module map properties file You can write the Module to parse the
BetterSprite however you want. The built in BetterSpriteModule replicates
the current functionality of LevelParser. For an example of this
class being awesome, look in Tower Defense under the levelparse
package. LevelButtons, a custom class, are created using custom
parameters.
ModularLevelParser layoutReader = new ModularLevelParser("moduleMapProperties");
addPlayField(layoutReader.getPlayfield(Resources.getString("mainMenuLayoutPath"), Resources.getGame()));
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ModularLevelParser
public ModularLevelParser(java.lang.String moduleMapPathKey)
setEventPool
public void setEventPool(EventPool eventPool)
processSprite
public void processSprite(org.w3c.dom.NodeList spritesList,
SpriteGroup group)
- Processes the Sprites within a SpriteGroup.
- Overrides:
processSprite
in class LevelParser
processBackgrounds
public void processBackgrounds(org.w3c.dom.NodeList backgrounds)
- Description copied from class:
LevelParser
- Processes the background
- Overrides:
processBackgrounds
in class LevelParser