fixed items display bug
This commit is contained in:
@@ -2,7 +2,7 @@ Room name: Circle Room
|
||||
Room Description: You are in a circular room. The windows to the east are covered with boards that<br>let in just enough light to see. You spot a man in a tailored suit moving some crates around.
|
||||
Locked: false
|
||||
Boarded: false
|
||||
Items: Shavingcream
|
||||
Items: Lightbulb, Candlestick
|
||||
Riddler: "Hello there. My name is Kevin and I am Sir Pellatt's butler. I understand that my master<comma><br>Sir Pellatt has wrongfully imprisoned you. If you answer my riddle<comma> I can give you something to<br>help you with your escape - nothing comes for free you know!", "What goes moo?", "Cows", Lockpick
|
||||
Exit Rooms: W-Apple Hallway
|
||||
|
||||
|
||||
@@ -197,12 +197,15 @@ class Room {
|
||||
boolean hasItems = false;
|
||||
String items = "";
|
||||
String itemString = "Items in room: ";
|
||||
if(this.getItems().size() > 0) {
|
||||
hasItems = true;
|
||||
for(int i = 0; i < this.getItems().size() - 1; i++) {
|
||||
hasItems = true;
|
||||
items += this.getItems().get(i).getName() + ", ";
|
||||
}
|
||||
if(hasItems) {
|
||||
items += this.getItems().get(this.getItems().size() - 1).getName();
|
||||
}
|
||||
if(hasItems) {
|
||||
return itemString + items;
|
||||
}else {
|
||||
return itemString + "none";
|
||||
|
||||
Reference in New Issue
Block a user