This commit is contained in:
2025-02-18 13:33:51 +01:00
parent 2368d3b492
commit e64a127c34
2 changed files with 4 additions and 3 deletions

View File

@@ -210,9 +210,7 @@ public class Game
} }
private void printRoomInformation(Room currentRoom) private void printRoomInformation(Room currentRoom)
{ {
System.out.println("You are " + currentRoom.getDescription()); System.out.print(currentRoom.getLongDescription());
System.out.print("Exits: ");
System.out.print(currentRoom.exitsToString());
System.out.println(); System.out.println();
} }
} }

View File

@@ -48,6 +48,9 @@ public class Room
{ {
return description; return description;
} }
public String getLongDescription() {
return "You are " + getDescription() + "\nExits: " + exitsToString();
}
public String exitsToString() { public String exitsToString() {
StringBuilder exitsInString = new StringBuilder(); StringBuilder exitsInString = new StringBuilder();