diff options
Diffstat (limited to 'src/esieequest/model/Game.java')
-rw-r--r-- | src/esieequest/model/Game.java | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/src/esieequest/model/Game.java b/src/esieequest/model/Game.java index 830b48c..6267d1a 100644 --- a/src/esieequest/model/Game.java +++ b/src/esieequest/model/Game.java | |||
@@ -7,9 +7,7 @@ import esieequest.model.doors.HiddenDoor; | |||
7 | import esieequest.model.doors.LockedDoor; | 7 | import esieequest.model.doors.LockedDoor; |
8 | import esieequest.model.doors.TransporterDoor; | 8 | import esieequest.model.doors.TransporterDoor; |
9 | import esieequest.model.doors.TrapDoor; | 9 | import esieequest.model.doors.TrapDoor; |
10 | import esieequest.model.items.Beamer; | ||
11 | import esieequest.model.items.Item; | 10 | import esieequest.model.items.Item; |
12 | import esieequest.model.items.KeyCard; | ||
13 | import esieequest.model.map.Direction; | 11 | import esieequest.model.map.Direction; |
14 | import esieequest.model.map.Room; | 12 | import esieequest.model.map.Room; |
15 | 13 | ||
@@ -86,8 +84,15 @@ public class Game { | |||
86 | this.d(Room.SECRET_CORRIDOR_ENTRANCE, Direction.SOUTH, Room.SECRET_LAB); | 84 | this.d(Room.SECRET_CORRIDOR_ENTRANCE, Direction.SOUTH, Room.SECRET_LAB); |
87 | this.d(Room.SECRET_CORRIDOR_ENTRANCE, Direction.EAST, Room.SECRET_CORRIDOR_END); | 85 | this.d(Room.SECRET_CORRIDOR_ENTRANCE, Direction.EAST, Room.SECRET_CORRIDOR_END); |
88 | this.d(Room.SECRET_CORRIDOR_END, Direction.NORTH, new TrapDoor(Room.DEAD_END)); | 86 | this.d(Room.SECRET_CORRIDOR_END, Direction.NORTH, new TrapDoor(Room.DEAD_END)); |
89 | this.d(Room.SECRET_CORRIDOR_END, Direction.SOUTH, new LockedDoor(Room.LOCKED_ROOM)); | 87 | |
90 | this.d(Room.LOCKED_ROOM, Direction.NORTH, new LockedDoor(Room.SECRET_CORRIDOR_END)); | 88 | final LockedDoor lockedDoorEnter = new LockedDoor(Room.LOCKED_ROOM); |
89 | lockedDoorEnter.setKey(Item.KEYCARD); | ||
90 | this.d(Room.SECRET_CORRIDOR_END, Direction.SOUTH, lockedDoorEnter); | ||
91 | |||
92 | final LockedDoor lockedDoorExit = new LockedDoor(Room.SECRET_CORRIDOR_END); | ||
93 | lockedDoorExit.setKey(Item.KEYCARD); | ||
94 | this.d(Room.LOCKED_ROOM, Direction.NORTH, lockedDoorExit); | ||
95 | |||
91 | this.d(Room.SECRET_CORRIDOR_END, Direction.EAST, new TransporterDoor(Room.values())); | 96 | this.d(Room.SECRET_CORRIDOR_END, Direction.EAST, new TransporterDoor(Room.values())); |
92 | } | 97 | } |
93 | 98 | ||
@@ -124,16 +129,13 @@ public class Game { | |||
124 | * Adds Item-s in the map. | 129 | * Adds Item-s in the map. |
125 | */ | 130 | */ |
126 | private void addItems() { | 131 | private void addItems() { |
127 | this.i(Room.STORAGE_ROOM, Direction.WEST, new Item("Weighted Storage Cube", 5, true)); | 132 | this.i(Room.STORAGE_ROOM, Direction.WEST, Item.STORAGE_CUBE); |
128 | this.i(Room.STORAGE_ROOM, Direction.EAST, new Item("Edgeless Safety Cube", 5, true)); | 133 | this.i(Room.STORAGE_ROOM, Direction.EAST, Item.SAFETY_CUBE); |
129 | this.i(Room.STORAGE_ROOM, Direction.NORTH, new Item("Portable black-hole", -10, false)); | 134 | this.i(Room.STORAGE_ROOM, Direction.NORTH, Item.BLACK_HOLE); |
130 | 135 | ||
131 | this.i(Room.SECRET_LAB, Direction.SOUTH, new Beamer("Beamer")); | 136 | this.i(Room.SECRET_LAB, Direction.SOUTH, Item.BEAMER); |
132 | 137 | ||
133 | KeyCard keyCard = new KeyCard("KeyCard"); | 138 | this.i(Room.DEAD_END, Direction.NORTH, Item.KEYCARD); |
134 | this.i(Room.DEAD_END, Direction.NORTH, keyCard); | ||
135 | ((LockedDoor) Room.SECRET_CORRIDOR_END.getSide(Direction.SOUTH).getDoor()).setKey(keyCard); | ||
136 | ((LockedDoor) Room.LOCKED_ROOM.getSide(Direction.NORTH).getDoor()).setKey(keyCard); | ||
137 | } | 139 | } |
138 | 140 | ||
139 | /** | 141 | /** |