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()); }
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(); }
public double distanceTo(Point other) { CartesianPoint thisPoint = asCartesianPoint(); return thisPoint.distanceTo(other); }