diff options
Diffstat (limited to 'src/esieequest/model/map/LockedDoor.java')
-rw-r--r-- | src/esieequest/model/map/LockedDoor.java | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/src/esieequest/model/map/LockedDoor.java b/src/esieequest/model/map/LockedDoor.java deleted file mode 100644 index 6f5f15e..0000000 --- a/src/esieequest/model/map/LockedDoor.java +++ /dev/null | |||
@@ -1,55 +0,0 @@ | |||
1 | package esieequest.model.map; | ||
2 | |||
3 | import esieequest.model.items.KeyCard; | ||
4 | |||
5 | /** | ||
6 | * A door that links two rooms and requires a keycard to pass through. | ||
7 | * | ||
8 | * @author Pacien TRAN-GIRARD | ||
9 | */ | ||
10 | public class LockedDoor extends Door { | ||
11 | |||
12 | private KeyCard keyCard; | ||
13 | |||
14 | /** | ||
15 | * Creates a new locked door. | ||
16 | * | ||
17 | * @param destination | ||
18 | * the destination Room | ||
19 | */ | ||
20 | public LockedDoor(final Room destination) { | ||
21 | super(destination); | ||
22 | } | ||
23 | |||
24 | /** | ||
25 | * Returns the KeyCard that opens this door. | ||
26 | * | ||
27 | * @return the KeyCard | ||
28 | */ | ||
29 | public KeyCard getKey() { | ||
30 | return this.keyCard; | ||
31 | } | ||
32 | |||
33 | /** | ||
34 | * Sets the KeyCard authorised to open this door. | ||
35 | * | ||
36 | * @param keyCard | ||
37 | * the KeyCard to set | ||
38 | */ | ||
39 | public void setKey(final KeyCard keyCard) { | ||
40 | this.keyCard = keyCard; | ||
41 | } | ||
42 | |||
43 | /** | ||
44 | * Tells if a given KeyCard can open this door. | ||
45 | * | ||
46 | * @param keyCard | ||
47 | * the KeyCard | ||
48 | * | ||
49 | * @return | ||
50 | */ | ||
51 | public boolean isAuthorised(final KeyCard keyCard) { | ||
52 | return keyCard == this.keyCard; | ||
53 | } | ||
54 | |||
55 | } | ||