vooga.engine.factory
Class LevelParser

java.lang.Object
  extended by vooga.engine.factory.LevelParser
All Implemented Interfaces:
LevelFactory
Direct Known Subclasses:
CyberionLevelParser, LevelParserExample, ModularLevelParser

public class LevelParser
extends java.lang.Object
implements LevelFactory

The LevelParser class can be used to process a LevelXML file and turn it into a PlayField. The LevelParser handles SpriteGroups, CollisionGroups, Backgrounds, Music, Maps, and Events.


Field Summary
static int FIRST_IMAGE
           
 
Constructor Summary
LevelParser()
           
 
Method Summary
 Game getGame()
           
 PlayField getIncompletePlayfield()
           
 OverlayTracker getOverlayTracker()
           
 PlayField getPlayfield(java.lang.String filepath, Game game)
           
static boolean isElement(org.w3c.dom.Node node)
           
 void processBackgrounds(org.w3c.dom.NodeList backgrounds)
          Processes the background
 void processSprite(org.w3c.dom.NodeList spritesList, SpriteGroup group)
          Processes the Sprites within a SpriteGroup.
 void processVisual(org.w3c.dom.NodeList visualsList, BetterSprite newSprite)
          Processes Visuals within a Sprite.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FIRST_IMAGE

public static final int FIRST_IMAGE
See Also:
Constant Field Values
Constructor Detail

LevelParser

public LevelParser()
Method Detail

getPlayfield

public PlayField getPlayfield(java.lang.String filepath,
                              Game game)
Specified by:
getPlayfield in interface LevelFactory
Returns:
Playfield for the current level

processSprite

public void processSprite(org.w3c.dom.NodeList spritesList,
                          SpriteGroup group)
Processes the Sprites within a SpriteGroup.


processVisual

public void processVisual(org.w3c.dom.NodeList visualsList,
                          BetterSprite newSprite)
Processes Visuals within a Sprite.


processBackgrounds

public void processBackgrounds(org.w3c.dom.NodeList backgrounds)
Processes the background


isElement

public static boolean isElement(org.w3c.dom.Node node)

getGame

public Game getGame()

getOverlayTracker

public OverlayTracker getOverlayTracker()

getIncompletePlayfield

public PlayField getIncompletePlayfield()