be.saltwater.jaqel.maze.loaders
Class XMLTileSetLoader

java.lang.Object
  extended bybe.saltwater.jaqel.maze.loaders.XMLTileSetLoader
All Implemented Interfaces:
TileSetLoader

public class XMLTileSetLoader
extends java.lang.Object
implements TileSetLoader

Provides support for loading a tileset from an XML file. That file must have the following format:

<tileset name="nameofyourtileset">
        <tile model="relative/path/to/your/objfile.obj" name="tile1" passable="true"/>
        <tile model="relative/path/to/your/other/objfile.obj" name="tile2" passable="false"/>
</tileset>

In the tile tag, the model attribute provides the relative filename to the WaveFront .obj-file, which contains the 3D model for that tile. The name attribute holds the name that is used to access that tile (by a Maze). The attribute "passable" defines whether or not a creature can walk on that type of tiles.

Author:
Bruno Windels
See Also:
TileSetLoader

Constructor Summary
XMLTileSetLoader()
           
 
Method Summary
 TileSet load(java.lang.String filename)
          Implementation of TileSetLoader.load() for this format (XML).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLTileSetLoader

public XMLTileSetLoader()
                 throws javax.xml.parsers.ParserConfigurationException
Method Detail

load

public TileSet load(java.lang.String filename)
             throws TileSetLoadException,
                    java.io.IOException,
                    java.text.ParseException
Implementation of TileSetLoader.load() for this format (XML).

Specified by:
load in interface TileSetLoader
Parameters:
filename - The filename of the document that contains the description of the tileset.
Throws:
java.io.IOException - When the file could not be read (file not found, file not readable, ...).
java.text.ParseException - When the document didn't have the expected format.
TileSetLoadException - When the document had the right format but certain resources could not be found (wrong uri to model files, ...), the loading was not 100% succesfull and you should first correct your file.
See Also:
TileSetLoader.load(String)