Example #1
0
 private static void loadRoom() {
   currentRoom = roomsTable.get(CartesianPoint.keyCreator());
   if (!(currentRoom instanceof Room)) {
     currentRoom = xml.loadRoom();
     roomsTable.put(CartesianPoint.keyCreator(), currentRoom);
   }
   GameGUI.addToConsole(currentRoom.getFullRoomDescription());
 }
Example #2
0
 public static void start(String questXMLFile) {
   xml = new XMLparser(questXMLFile);
   GameGUI.player = new Player();
   GameGUI.player.getInventory().clear();
   GameGUI.resetConsole();
   roomsTable = new Hashtable<String, Room>();
   CartesianPoint.setCoordinates(0, 0);
   GameGUI.updateGUI();
   GameGUI.addToConsole("Loaded scenario from " + questXMLFile);
   loadRoom();
 }
Example #3
0
 public double distanceTo(Point other) {
   CartesianPoint thisPoint = asCartesianPoint();
   return thisPoint.distanceTo(other);
 }