From 2e78266b159fa36cdc81d747345c91aea15c8f93 Mon Sep 17 00:00:00 2001 From: d0tslash <brian@kearneymail.com> Date: Sat, 23 Aug 2014 17:22:14 -0700 Subject: [PATCH] exit color and spacing --- .../java/com/comandante/creeper/Main.java | 20 +++++++++---------- .../creeper/managers/GameManager.java | 6 +++++- .../com/comandante/creeper/model/Room.java | 2 +- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/src/main/java/com/comandante/creeper/Main.java b/src/main/java/com/comandante/creeper/Main.java index 5aa03aad..1778a768 100644 --- a/src/main/java/com/comandante/creeper/Main.java +++ b/src/main/java/com/comandante/creeper/Main.java @@ -22,16 +22,16 @@ import java.io.File; public class Main { public static void main(String[] args) throws Exception { - Room lobby = new Room(1, Optional.of(2), Optional.<Integer>absent(), Optional.<Integer>absent(), Optional.<Integer>absent(), - "This is the lobby. It's pretty empty and the paint still smells fresh."); - Room hallway = new Room(2, Optional.of(3), Optional.<Integer>absent(), Optional.<Integer>absent(), Optional.of(1), - "This is the hallway. It's long and hallway-ish with exposed wires and floorboards showing."); - Room intake = new Room(3, Optional.<Integer>absent(), Optional.of(6), Optional.<Integer>absent(), Optional.of(2), - "This is the intake area. People are lined up like cattle waiting to be prodded."); - Room janitorialCloset = new Room(6, Optional.<Integer>absent(), Optional.<Integer>absent(), Optional.of(3), Optional.of(7), - "You find yourself in the janitorial closet. It smells like bleach."); - Room toilet = new Room(7, Optional.of(6), Optional.<Integer>absent(), Optional.<Integer>absent(), Optional.<Integer>absent(), - "You find yourself in the toilet. The smell is horrible."); + Room lobby = new Room(1, "Lobby", Optional.of(2), Optional.<Integer>absent(), Optional.<Integer>absent(), Optional.<Integer>absent(), + "This is the lobby. It's pretty empty and the paint still smells fresh.\r\n"); + Room hallway = new Room(2,"Hallway", Optional.of(3), Optional.<Integer>absent(), Optional.<Integer>absent(), Optional.of(1), + "This is the hallway. It's long and hallway-ish with exposed wires and floorboards showing.\r\n"); + Room intake = new Room(3, "Intake", Optional.<Integer>absent(), Optional.of(6), Optional.<Integer>absent(), Optional.of(2), + "This is the intake area. People are lined up like cattle waiting to be prodded.\r\n"); + Room janitorialCloset = new Room(6, "Closet", Optional.<Integer>absent(), Optional.<Integer>absent(), Optional.of(3), Optional.of(7), + "You find yourself in the janitorial closet. It smells like bleach.\r\n"); + Room toilet = new Room(7, "Toilet", Optional.of(6), Optional.<Integer>absent(), Optional.<Integer>absent(), Optional.<Integer>absent(), + "You find yourself in the toilet. The smell is horrible.\r\n"); RoomManager roomManager = new RoomManager(); roomManager.addRoom(lobby); diff --git a/src/main/java/com/comandante/creeper/managers/GameManager.java b/src/main/java/com/comandante/creeper/managers/GameManager.java index 281b6b61..f589e14c 100644 --- a/src/main/java/com/comandante/creeper/managers/GameManager.java +++ b/src/main/java/com/comandante/creeper/managers/GameManager.java @@ -217,7 +217,7 @@ public class GameManager { private String getExits(Room room) { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append("[ Exits: "); - stringBuilder.append(new Ansi().fg(Ansi.Color.BLUE).toString()); + stringBuilder.append(new Ansi().fg(Ansi.Color.GREEN).toString()); if (room.getNorthId().isPresent()) { stringBuilder.append("North "); } @@ -238,6 +238,10 @@ public class GameManager { Player player = playerManager.getPlayer(playerId); final Room playerCurrentRoom = getPlayerCurrentRoom(player).get(); StringBuilder sb = new StringBuilder(); + sb.append("\r\n"); + sb.append(new Ansi().fg(Ansi.Color.GREEN).toString()); + sb.append(playerCurrentRoom.getRoomTitle()).append("\r\n\r\n"); + sb.append(new Ansi().reset().toString()); sb.append(playerCurrentRoom.getRoomDescription()).append("\r\n"); sb.append(getExits(playerCurrentRoom)); for (String searchPlayerId : playerCurrentRoom.getPresentPlayerIds()) { diff --git a/src/main/java/com/comandante/creeper/model/Room.java b/src/main/java/com/comandante/creeper/model/Room.java index 3787b8b3..1d2481a1 100644 --- a/src/main/java/com/comandante/creeper/model/Room.java +++ b/src/main/java/com/comandante/creeper/model/Room.java @@ -70,7 +70,7 @@ public class Room { } public String getRoomDescription() { - return new Ansi().fg(Ansi.Color.GREEN).render(roomDescription).toString() + new Ansi().reset().toString(); + return roomDescription; } public Integer getRoomId() { -- GitLab