zork2Class
Class DungeonFileReader

java.lang.Object
  |
  +--zork2Class.DungeonFileReader

public class DungeonFileReader
extends java.lang.Object

This class permit to read the configuration file "dungeon.zdu". This file is file which contains the configuration of a dungeon for ZorkII.
<center>The meaning of the different tag</center>

  1. <DUNGEON> show the begin of a dungeon file configuration. -->You should use </DUNGEON>, to close the file. It should be the last tag. This tag is obligatory. If between <DUNGEON> et </DUNGEON>, there are no firstRoom, no finalRoom attribut, the become unvalide.
  2. <DOOR>this tag is used when you like to show the begin of the list of the door. -->You should use </DOOR>, to mark the end of the door of a room enumeration.
  3. <CHEST>this tag is used when you like to show the begin of the list of the chest attribut -->You should use </CHEST>, to mark the end of the chest attributs.
  4. <ITEM>this tag is used when you like to show the begin of a item position. -->You should use </ITEM>, to mark the end of the item attributs.
  5. <COMMENTS>this tag is used when you like to add comments in the file Dungeon.zdu -->You should use </COMMENTS>, to mark the end of the comments.
  6. <SOUTH>this tag is used when you like to show the begin of a south door attribut. -->You should use </SOUTH>, to mark the end.
  7. <NORTH>this tag is used when you like to show the begin of a north door attribut. -->You should use </NORTH>, to mark the end.
  8. <EAST>this tag is used when you like to show the begin of a east door attribut. -->You should use </EAST>, to mark the end.
  9. <WEST>this tag is used when you like to show the begin of a west door attribut. -->You should use </WEST>, to mark the end.
WARNING :For using this class, you should have create three files which named ordeal.zor, item.zit and dungeon.zor. This files should be create in the same directory. The directory is the directory which is put as parameter of the constructor..

Version:
1.0, 28/03/03
Author:
IUT de Vannes, Fabien BOYERE

Constructor Summary
DungeonFileReader(java.lang.String str)
          This constructor permit to build a new object which permit to load a dungeon for Zork2.
 
Method Summary
 Room getFinalRoom()
          Returns the finalRoom.
 java.lang.String getFinalRoomName()
          Returns the finalRoom name.
 Room getFirstRoom()
          Returns the firstRoom.
 java.lang.String getFirstRoomName()
          Returns the firstRoom name.
 java.util.Hashtable getListRooms()
          Returns the listRooms.
 java.lang.String getNameDungeon()
          Returns the nameDungeon.
 java.util.Hashtable getTableItems()
          Returns the tableItems.
 java.util.Hashtable getTableOrdeals()
          Returns the tableOrdeals.
 boolean readDungeonFile()
          This method is a methode which permit to read a file dungeon.zdu.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DungeonFileReader

public DungeonFileReader(java.lang.String str)
This constructor permit to build a new object which permit to load a dungeon for Zork2. A dungeon with its item, its ordeal and its rooms...etc

Method Detail

readDungeonFile

public boolean readDungeonFile()
This method is a methode which permit to read a file dungeon.zdu. This method read the file and build a dongeon which is composed by room. This method check if all the room has been exist.

Returns:
boolean - Return false, if the file hasn't correctly loaded or the file hasn't correcty write (lack of tag or other).

getFinalRoomName

public java.lang.String getFinalRoomName()
Returns the finalRoom name.

Returns:
String the final room name

getFinalRoom

public Room getFinalRoom()
Returns the finalRoom.

Returns:
Room the final room

getFirstRoomName

public java.lang.String getFirstRoomName()
Returns the firstRoom name.

Returns:
String the first room name

getFirstRoom

public Room getFirstRoom()
Returns the firstRoom.

Returns:
Room the first room

getListRooms

public java.util.Hashtable getListRooms()
Returns the listRooms. The listRoom is the hashtable which contain all the rooms.

Returns:
Hashtable containing dungeon's rooms

getTableItems

public java.util.Hashtable getTableItems()
Returns the tableItems.

Returns:
Hashtable containing dungeon's items

getNameDungeon

public java.lang.String getNameDungeon()
Returns the nameDungeon.

Returns:
String dungeon's name

getTableOrdeals

public java.util.Hashtable getTableOrdeals()
Returns the tableOrdeals.

Returns:
Hashtable containing dungeon's ordeal