diff options
Diffstat (limited to 'src/esieequest/game/doors/TrapDoor.java')
-rw-r--r-- | src/esieequest/game/doors/TrapDoor.java | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/esieequest/game/doors/TrapDoor.java b/src/esieequest/game/doors/TrapDoor.java new file mode 100644 index 0000000..ae1b733 --- /dev/null +++ b/src/esieequest/game/doors/TrapDoor.java | |||
@@ -0,0 +1,32 @@ | |||
1 | package esieequest.game.doors; | ||
2 | |||
3 | import esieequest.game.Game; | ||
4 | import esieequest.game.map.Room; | ||
5 | import esieequest.ui.Viewable; | ||
6 | |||
7 | /** | ||
8 | * A one-way door that links two rooms and prevent the usage of the 'back' | ||
9 | * command. | ||
10 | * | ||
11 | * @author Pacien TRAN-GIRARD | ||
12 | */ | ||
13 | public class TrapDoor extends Door { | ||
14 | |||
15 | /** | ||
16 | * Creates a new trap door. | ||
17 | * | ||
18 | * @param destination | ||
19 | * the destination Room. | ||
20 | */ | ||
21 | public TrapDoor(final Room destination) { | ||
22 | super(destination); | ||
23 | } | ||
24 | |||
25 | @Override | ||
26 | public boolean cross(final Game game, final Viewable view) { | ||
27 | final boolean crossed = super.cross(game, view); | ||
28 | game.getPlayer().clearRoomHistory(); | ||
29 | return crossed; | ||
30 | } | ||
31 | |||
32 | } | ||