made changing descriptions and added a spicy new riddle
This commit is contained in:
@@ -61,7 +61,7 @@ class Game {
|
||||
room.setDescription(roomDescription.split(": ")[1].replaceAll("<br>", "\n").trim());
|
||||
//Read room description after riddler is removed.
|
||||
String newRoomDescription = roomScanner.nextLine();
|
||||
room.setNewRoomDescription(newRoomDescription.split(": ")[1].replaceAll("<br>", "\n").trim());
|
||||
room.setNewRoomDescription(newRoomDescription.substring(newRoomDescription.indexOf(":") + 1,newRoomDescription.length()).replaceAll("<br>", "\n").trim());
|
||||
// Read the locked state
|
||||
boolean locked = Boolean.parseBoolean(roomScanner.nextLine().split(": ")[1].replaceAll("<br>", "\n").trim());
|
||||
room.setLocked(locked);
|
||||
|
||||
@@ -25,7 +25,7 @@ import com.bayviewglen.zork.Items.*;
|
||||
class Room {
|
||||
private String roomName;
|
||||
private String description;
|
||||
private String newRoomDescription;
|
||||
private String newDescription;
|
||||
private HashMap<String, Room> exits; // stores exits of this room.
|
||||
private ArrayList<Item> items;
|
||||
private Riddler riddler; //needs to altered outside of the class so that riddler can be set to null.
|
||||
@@ -254,6 +254,7 @@ class Room {
|
||||
|
||||
public void removeRiddler() {
|
||||
riddler = null;
|
||||
this.description = newDescription;
|
||||
|
||||
}
|
||||
|
||||
@@ -266,7 +267,7 @@ class Room {
|
||||
}
|
||||
|
||||
public void setNewRoomDescription(String newRoomDesc) {
|
||||
this.newRoomDescription = newRoomDesc;
|
||||
this.newDescription = newRoomDesc;
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user