From c2561834edfcc974e864c6ce8cb437feb1f63b16 Mon Sep 17 00:00:00 2001
From: d0tslash <brian@kearneymail.com>
Date: Sun, 24 Aug 2014 22:00:41 -0700
Subject: [PATCH] room builder

---
 .../java/com/comandante/creeper/Main.java     |  88 ++------
 .../creeper/builder/RoomBuilders.java         | 201 ++++++++++++++++++
 2 files changed, 213 insertions(+), 76 deletions(-)
 create mode 100644 src/main/java/com/comandante/creeper/builder/RoomBuilders.java

diff --git a/src/main/java/com/comandante/creeper/Main.java b/src/main/java/com/comandante/creeper/Main.java
index 31be409c..18eba1b2 100644
--- a/src/main/java/com/comandante/creeper/Main.java
+++ b/src/main/java/com/comandante/creeper/Main.java
@@ -2,6 +2,7 @@ package com.comandante.creeper;
 
 import com.comandante.creeper.Items.Item;
 import com.comandante.creeper.Items.ItemType;
+import com.comandante.creeper.builder.RoomBuilders;
 import com.comandante.creeper.command.CommandService;
 import com.comandante.creeper.command.DefaultCommandHandler;
 import com.comandante.creeper.managers.EntityManager;
@@ -45,82 +46,17 @@ public class Main {
 
         GameManager gameManager = new GameManager(roomManager, playerManager, entityManager);
 
-        entityManager.addEntity(new BasicRoom(
-                1,
-                "Entrance to Federation Training Encampment",
-                Optional.of(2),
-                Optional.<Integer>absent(),
-                Optional.<Integer>absent(),
-                Optional.<Integer>absent(),
-                Optional.<Integer>absent(),
-                Optional.<Integer>absent(),
-                "You are standing before the Federation Training Encampment. A huge wall surrounds the base. To the north you see a two doors leading inside. Above the doors you sits the symbol of the Federation, a single red star with five points and a raised fist in the center. Sentries along the encampment walls begin to eye you suspiciously. You then remember that malingering in front of a Federation base could prove to be a fatal mistake.\r\n"));
-
-        entityManager.addEntity(new BasicRoom(
-                2,
-                "Quarter Deck",
-                Optional.of(3),
-                Optional.of(1),
-                Optional.of(4),
-                Optional.of(5),
-                Optional.of(6),
-                Optional.<Integer>absent(),
-                "You are standing on the quarter deck of the Training Encampment. Federation flags line the walls of this large room. A statue of the Grand Marshal of the Federation sit in the back. A Private on watch is behind a desk in the center of the room. To the west you hear the sounds of gun fire. To the east a sentry stands by a door waiting to scan the credentials of anyone looking for access to the armory. A staircase leads up stairs. You get the feeling only high ranking officers are allowed on the second floor. To the north is a door leading to the training fields.\r\n"));
-
-        entityManager.addEntity(new BasicRoom(
-                3,
-                "Training Field",
-                Optional.of(7),
-                Optional.of(2),
-                Optional.<Integer>absent(),
-                Optional.<Integer>absent(),
-                Optional.<Integer>absent(),
-                Optional.<Integer>absent(),
-                "You are standing on the center of a massive training field. You see a large field with a track surrounding it. A main pathway connects from the Port to the north to the main Federation building. Soldiers of all ranks are going about their business here.\r\n"));
-
-        entityManager.addEntity(new BasicRoom(
-                4,
-                "Armory",
-                Optional.<Integer>absent(),
-                Optional.<Integer>absent(),
-                Optional.<Integer>absent(),
-                Optional.of(2),
-                Optional.<Integer>absent(),
-                Optional.<Integer>absent(),
-                "You are standing in the Federation Training Encampment armory. A counter extends from wall to wall separating you from the stock. A Lieutenant is standing behind the counter filling out paper work. You can see shelves extending to the back of the room fully stocked with Federation issued weapons. The door closes and locks behind you.\r\n"));
-
-        entityManager.addEntity(new BasicRoom(
-                5,
-                "Firing Range",
-                Optional.<Integer>absent(),
-                Optional.<Integer>absent(),
-                Optional.of(2),
-                Optional.<Integer>absent(),
-                Optional.<Integer>absent(),
-                Optional.<Integer>absent(),
-                "You are standing in the Federation Training Encampment firing range. You see many rows each separated by a blaster proof divider. At the end of each row sits a target. The sounds of weapon fire fills the room. Straight ahead you see an empty row. Down Range a target is hovering, waiting to be shot.\r\n"));
-
-        entityManager.addEntity(new BasicRoom(
-                6,
-                "Marshal's Office",
-                Optional.<Integer>absent(),
-                Optional.<Integer>absent(),
-                Optional.<Integer>absent(),
-                Optional.<Integer>absent(),
-                Optional.<Integer>absent(),
-                Optional.of(2),
-                "You are standing in the Marshal's office. A beautiful wooden desk sits in the center of the room. Shelves and bookcases line the walls showing off some of the Marshals accomplishments. A floor to ceiling window in the back of the room looks over the training fields. \r\n"));
-
-        entityManager.addEntity(new BasicRoom(
-                7,
-                "Port",
-                Optional.<Integer>absent(),
-                Optional.of(3),
-                Optional.<Integer>absent(),
-                Optional.<Integer>absent(),
-                Optional.<Integer>absent(),
-                Optional.<Integer>absent(),
-                "You are standing in the main port of the Federation Encampment.\r\n"));
+        // build zones
+
+        RoomBuilders.buildFedTraining(entityManager);
+
+        RoomBuilders.buildSpacePort(entityManager);
+
+        RoomBuilders.buildNeoPortland(entityManager);
+
+        RoomBuilders.buildOldtown(entityManager);
+
+        // zones end
 
         entityManager.addEntity(new Derper(gameManager, 1));
 
diff --git a/src/main/java/com/comandante/creeper/builder/RoomBuilders.java b/src/main/java/com/comandante/creeper/builder/RoomBuilders.java
new file mode 100644
index 00000000..cbab5d89
--- /dev/null
+++ b/src/main/java/com/comandante/creeper/builder/RoomBuilders.java
@@ -0,0 +1,201 @@
+package com.comandante.creeper.builder;
+
+import com.comandante.creeper.managers.EntityManager;
+import com.comandante.creeper.model.BasicRoom;
+import com.google.common.base.Optional;
+
+/**
+ * Created by Brian Kearney on 8/24/2014.
+ */
+public class RoomBuilders {
+
+    public static void buildFedTraining(EntityManager entityManager){
+
+        entityManager.addEntity(new BasicRoom(
+                1,
+                "Entrance to Federation Training Encampment",
+                Optional.of(2),
+                Optional.<Integer>absent(),
+                Optional.<Integer>absent(),
+                Optional.<Integer>absent(),
+                Optional.<Integer>absent(),
+                Optional.<Integer>absent(),
+                "You are standing before the Federation Training Encampment. A huge wall surrounds the base. To the north you see a two doors leading inside. Above the doors you sits the symbol of the Federation, a single red star with five points and a raised fist in the center. Sentries along the encampment walls begin to eye you suspiciously. You then remember that malingering in front of a Federation base could prove to be a fatal mistake.\r\n"));
+
+        entityManager.addEntity(new BasicRoom(
+                2,
+                "Quarter Deck",
+                Optional.of(3),
+                Optional.of(1),
+                Optional.of(4),
+                Optional.of(5),
+                Optional.of(6),
+                Optional.<Integer>absent(),
+                "You are standing on the quarter deck of the Training Encampment. Federation flags line the walls of this large room. A statue of the Grand Marshal of the Federation sit in the back. A Private on watch is behind a desk in the center of the room. To the west you hear the sounds of gun fire. To the east a sentry stands by a door waiting to scan the credentials of anyone looking for access to the armory. A staircase leads up stairs. You get the feeling only high ranking officers are allowed on the second floor. To the north is a door leading to the training fields.\r\n"));
+
+        entityManager.addEntity(new BasicRoom(
+                3,
+                "Training Field",
+                Optional.of(7),
+                Optional.of(2),
+                Optional.<Integer>absent(),
+                Optional.<Integer>absent(),
+                Optional.<Integer>absent(),
+                Optional.<Integer>absent(),
+                "You are standing on the center of a massive training field. You see a large field with a track surrounding it. A main pathway connects from the Port to the north to the main Federation building. Soldiers of all ranks are going about their business here.\r\n"));
+
+        entityManager.addEntity(new BasicRoom(
+                4,
+                "Armory",
+                Optional.<Integer>absent(),
+                Optional.<Integer>absent(),
+                Optional.<Integer>absent(),
+                Optional.of(2),
+                Optional.<Integer>absent(),
+                Optional.<Integer>absent(),
+                "You are standing in the Federation Training Encampment armory. A counter extends from wall to wall separating you from the stock. A Lieutenant is standing behind the counter filling out paper work. You can see shelves extending to the back of the room fully stocked with Federation issued weapons. The door closes and locks behind you.\r\n"));
+
+        entityManager.addEntity(new BasicRoom(
+                5,
+                "Firing Range",
+                Optional.<Integer>absent(),
+                Optional.<Integer>absent(),
+                Optional.of(2),
+                Optional.<Integer>absent(),
+                Optional.<Integer>absent(),
+                Optional.<Integer>absent(),
+                "You are standing in the Federation Training Encampment firing range. You see many rows each separated by a blaster proof divider. At the end of each row sits a target. The sounds of weapon fire fills the room. Straight ahead you see an empty row. Down Range a target is hovering, waiting to be shot.\r\n"));
+
+        entityManager.addEntity(new BasicRoom(
+                6,
+                "Marshal's Office",
+                Optional.<Integer>absent(),
+                Optional.<Integer>absent(),
+                Optional.<Integer>absent(),
+                Optional.<Integer>absent(),
+                Optional.<Integer>absent(),
+                Optional.of(2),
+                "You are standing in the Marshal's office. A beautiful wooden desk sits in the center of the room. Shelves and bookcases line the walls showing off some of the Marshals accomplishments. A floor to ceiling window in the back of the room looks over the training fields. \r\n"));
+
+        entityManager.addEntity(new BasicRoom(
+                7,
+                "Port",
+                Optional.of(100),
+                Optional.of(3),
+                Optional.of(200),
+                Optional.of(300),
+                Optional.<Integer>absent(),
+                Optional.<Integer>absent(),
+                "You are standing in the main port of the Federation Encampment.\r\n"));
+
+    }
+
+    public static void buildNeoPortland(EntityManager entityManager){
+
+        entityManager.addEntity(new BasicRoom(
+                200,
+                "New Portland",
+                Optional.<Integer>absent(),
+                Optional.<Integer>absent(),
+                Optional.<Integer>absent(),
+                Optional.of(7),
+                Optional.<Integer>absent(),
+                Optional.<Integer>absent(),
+                "Start of New Portland area.\r\n"));
+    }
+
+    public static void buildOldtown(EntityManager entityManager){
+
+        entityManager.addEntity(new BasicRoom(
+                300,
+                "Old Town",
+                Optional.<Integer>absent(),
+                Optional.<Integer>absent(),
+                Optional.of(7),
+                Optional.<Integer>absent(),
+                Optional.<Integer>absent(),
+                Optional.<Integer>absent(),
+                "Start of Old Town area.\r\n"));
+    }
+
+    public static void buildSpacePort(EntityManager entityManager) {
+
+        entityManager.addEntity(new BasicRoom(
+                100,
+                "Tacoma Space Port",
+                Optional.of(101),
+                Optional.of(7),
+                Optional.<Integer>absent(),
+                Optional.<Integer>absent(),
+                Optional.<Integer>absent(),
+                Optional.<Integer>absent(),
+                "Start of Space Port area.\r\n"));
+
+        entityManager.addEntity(new BasicRoom(
+                101,
+                "Tacoma Space Port",
+                Optional.of(102),
+                Optional.of(100),
+                Optional.<Integer>absent(),
+                Optional.<Integer>absent(),
+                Optional.<Integer>absent(),
+                Optional.<Integer>absent(),
+                "Space Port area.\r\n"));
+
+        entityManager.addEntity(new BasicRoom(
+                102,
+                "Tacoma Space Port",
+                Optional.of(103),
+                Optional.of(101),
+                Optional.<Integer>absent(),
+                Optional.<Integer>absent(),
+                Optional.<Integer>absent(),
+                Optional.<Integer>absent(),
+                "Space Port area.\r\n"));
+
+        entityManager.addEntity(new BasicRoom(
+                103,
+                "Tacoma Space Port 3",
+                Optional.<Integer>absent(),
+                Optional.of(102),
+                Optional.<Integer>absent(),
+                Optional.of(104),
+                Optional.<Integer>absent(),
+                Optional.<Integer>absent(),
+                "Space Port area.\r\n"));
+
+        entityManager.addEntity(new BasicRoom(
+                104,
+                "Space Port Terminal 1",
+                Optional.<Integer>absent(),
+                Optional.<Integer>absent(),
+                Optional.of(103),
+                Optional.of(105),
+                Optional.<Integer>absent(),
+                Optional.<Integer>absent(),
+                "Terminal 1 of the Tacoma Space Port.\r\n"));
+
+        entityManager.addEntity(new BasicRoom(
+                105,
+                "Space Port Terminal 1",
+                Optional.<Integer>absent(),
+                Optional.<Integer>absent(),
+                Optional.of(104),
+                Optional.of(106),
+                Optional.<Integer>absent(),
+                Optional.<Integer>absent(),
+                "Terminal 1 of the Tacoma Space Port.\r\n"));
+
+        entityManager.addEntity(new BasicRoom(
+                106,
+                "Space Port Terminal 1",
+                Optional.<Integer>absent(),
+                Optional.<Integer>absent(),
+                Optional.of(105),
+                Optional.<Integer>absent(),
+                Optional.<Integer>absent(),
+                Optional.<Integer>absent(),
+                "Terminal 1 of the Tacoma Space Port.\r\n"));
+
+    }
+}
-- 
GitLab