public class DungeonFactory extends Object
Dungeon. All AI, levels,
etc. are correctly registered as part of the process.
Note that in a richer app this would be an interface and provide a
way to define multiple factories. These would be identified by some
naming scheme, and then multiple file formats could be used. This
would also make it easy to support different underlying
representation of the levels (as opposed to the exclusive use of
SimpleBoard).
| Constructor and Description |
|---|
DungeonFactory() |
| Modifier and Type | Method and Description |
|---|---|
static GameConnector |
loadDungeon(StreamTokenizer stok,
String gameName,
Set<Integer> impassableSprites,
Game lobby)
This method takes a
StreamTokenizer that is setup at
the start of a single dungeon file, and loads all the data, creating
the AIs, stitching together all connectors between levels, etc. |
protected static final Logger logger
public static GameConnector loadDungeon(StreamTokenizer stok, String gameName, Set<Integer> impassableSprites, Game lobby) throws IOException
StreamTokenizer that is setup at
the start of a single dungeon file, and loads all the data, creating
the AIs, stitching together all connectors between levels, etc. At
the end a single Connector is provded as an entry
point to the dungeon.stok - the stream to tokenizegameName - the name of the dungeon this is being loaded intoimpassableSprites - the set of identifiers that are impassablelobby - the lobbyGameConnector that is the
connection between the dungeon and the lobbyIOException - if the stream isn't formatted correctlyCopyright © 2013. All Rights Reserved.