aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/esieequest/controller/Performer.java13
-rw-r--r--src/esieequest/model/entities/Player.java1
-rw-r--r--src/esieequest/model/events/Quest.java5
-rw-r--r--src/esieequest/model/items/Beamer.java8
-rw-r--r--src/esieequest/model/items/Inventory.java7
-rw-r--r--src/esieequest/model/items/KeyCard.java6
-rw-r--r--src/esieequest/model/map/Door.java11
-rw-r--r--src/esieequest/model/map/HiddenDoor.java6
-rw-r--r--src/esieequest/model/map/LockedDoor.java6
-rw-r--r--src/esieequest/model/map/TrapDoor.java6
10 files changed, 66 insertions, 3 deletions
diff --git a/src/esieequest/controller/Performer.java b/src/esieequest/controller/Performer.java
index 8c61f3a..eb1cf9a 100644
--- a/src/esieequest/controller/Performer.java
+++ b/src/esieequest/controller/Performer.java
@@ -60,6 +60,7 @@ class Performer {
60 */ 60 */
61 public void newGame() { 61 public void newGame() {
62 // this.loadGame(default game); 62 // this.loadGame(default game);
63 // TODO
63 this.view.enable(); 64 this.view.enable();
64 this.echo(this.game.getWelcomeMessage()); 65 this.echo(this.game.getWelcomeMessage());
65 } 66 }
@@ -68,6 +69,7 @@ class Performer {
68 * Loads a saved game. 69 * Loads a saved game.
69 */ 70 */
70 public void loadGame() { 71 public void loadGame() {
72 // TODO
71 this.notImplemented(); 73 this.notImplemented();
72 } 74 }
73 75
@@ -75,6 +77,7 @@ class Performer {
75 * Saves the current game. 77 * Saves the current game.
76 */ 78 */
77 public void saveGame() { 79 public void saveGame() {
80 // TODO
78 this.notImplemented(); 81 this.notImplemented();
79 } 82 }
80 83
@@ -82,6 +85,7 @@ class Performer {
82 * Toggles the sound. 85 * Toggles the sound.
83 */ 86 */
84 public void toggleSound() { 87 public void toggleSound() {
88 // TODO
85 this.notImplemented(); 89 this.notImplemented();
86 } 90 }
87 91
@@ -142,6 +146,9 @@ class Performer {
142 this.walk(); 146 this.walk();
143 } 147 }
144 148
149 /**
150 * Increments and checks the number of steps made by the player.
151 */
145 private void walk() { 152 private void walk() {
146 this.game.getPlayer().setNbSteps(this.game.getPlayer().getNbSteps() + 1); 153 this.game.getPlayer().setNbSteps(this.game.getPlayer().getNbSteps() + 1);
147 if (this.game.getPlayer().getNbSteps() == this.game.getPlayer().getMaxNbSteps()) { 154 if (this.game.getPlayer().getNbSteps() == this.game.getPlayer().getMaxNbSteps()) {
@@ -220,6 +227,12 @@ class Performer {
220 this.echo(Utils.list(this.game.getPlayer().getInventory().getItemList(), "Items:", "No item in your inventory.")); 227 this.echo(Utils.list(this.game.getPlayer().getInventory().getItemList(), "Items:", "No item in your inventory."));
221 } 228 }
222 229
230 /**
231 * Performs an action according to the use of an item.
232 *
233 * @param itemName
234 * the item's name
235 */
223 public void useItem(final String itemName) { 236 public void useItem(final String itemName) {
224 final Item item = this.game.getPlayer().getInventory().getItem(itemName); 237 final Item item = this.game.getPlayer().getInventory().getItem(itemName);
225 if (item == null) { 238 if (item == null) {
diff --git a/src/esieequest/model/entities/Player.java b/src/esieequest/model/entities/Player.java
index 11a893f..4190eaa 100644
--- a/src/esieequest/model/entities/Player.java
+++ b/src/esieequest/model/entities/Player.java
@@ -6,6 +6,7 @@ import esieequest.model.items.Inventory;
6import esieequest.model.map.Room; 6import esieequest.model.map.Room;
7 7
8/** 8/**
9 * A player.
9 * 10 *
10 * @author Pacien TRAN-GIRARD 11 * @author Pacien TRAN-GIRARD
11 * @author Benoît LUBRANO DI SBARAGLIONE 12 * @author Benoît LUBRANO DI SBARAGLIONE
diff --git a/src/esieequest/model/events/Quest.java b/src/esieequest/model/events/Quest.java
index 352d764..30c4aa0 100644
--- a/src/esieequest/model/events/Quest.java
+++ b/src/esieequest/model/events/Quest.java
@@ -1,5 +1,10 @@
1package esieequest.model.events; 1package esieequest.model.events;
2 2
3/**
4 * A quest that can be completed in the game.
5 *
6 * @author Pacien TRAN-GIRARD
7 */
3public class Quest { 8public class Quest {
4 9
5 private String title; 10 private String title;
diff --git a/src/esieequest/model/items/Beamer.java b/src/esieequest/model/items/Beamer.java
index 5618ea8..a1e0c34 100644
--- a/src/esieequest/model/items/Beamer.java
+++ b/src/esieequest/model/items/Beamer.java
@@ -14,16 +14,18 @@ public class Beamer extends Item {
14 private Room room; 14 private Room room;
15 15
16 /** 16 /**
17 * Creates a Beamer. 17 * Creates a new Beamer.
18 * 18 *
19 * @param description 19 * @param description
20 * @param weight 20 * the description of the Beamer
21 */ 21 */
22 public Beamer(final String description) { 22 public Beamer(final String description) {
23 super(description, true); 23 super(description, true);
24 } 24 }
25 25
26 /** 26 /**
27 * Returns the memorised Room.
28 *
27 * @return the room 29 * @return the room
28 */ 30 */
29 public Room getRoom() { 31 public Room getRoom() {
@@ -31,6 +33,8 @@ public class Beamer extends Item {
31 } 33 }
32 34
33 /** 35 /**
36 * Sets the Room to memorise.
37 *
34 * @param room 38 * @param room
35 * the room to set 39 * the room to set
36 */ 40 */
diff --git a/src/esieequest/model/items/Inventory.java b/src/esieequest/model/items/Inventory.java
index 94691ad..6091872 100644
--- a/src/esieequest/model/items/Inventory.java
+++ b/src/esieequest/model/items/Inventory.java
@@ -103,12 +103,17 @@ public class Inventory {
103 * 103 *
104 * @param itemName 104 * @param itemName
105 * the item's name 105 * the item's name
106 * @return 106 * @return the weight of the item
107 */ 107 */
108 public int getItemWeight(final String itemName) { 108 public int getItemWeight(final String itemName) {
109 return this.items.get(itemName).getWeight(); 109 return this.items.get(itemName).getWeight();
110 } 110 }
111 111
112 /**
113 * Returns the sum of the weight of all the items.
114 *
115 * @return the total weight
116 */
112 public int getTotalWeight() { 117 public int getTotalWeight() {
113 int totalWeight = 0; 118 int totalWeight = 0;
114 for (final Item item : this.items.values()) { 119 for (final Item item : this.items.values()) {
diff --git a/src/esieequest/model/items/KeyCard.java b/src/esieequest/model/items/KeyCard.java
index 1579ee1..dee3a08 100644
--- a/src/esieequest/model/items/KeyCard.java
+++ b/src/esieequest/model/items/KeyCard.java
@@ -7,6 +7,12 @@ package esieequest.model.items;
7 */ 7 */
8public class KeyCard extends Item { 8public class KeyCard extends Item {
9 9
10 /**
11 * Creates a new KeyCard
12 *
13 * @param description
14 * the description of the KeyCard
15 */
10 public KeyCard(final String description) { 16 public KeyCard(final String description) {
11 super(description, false); 17 super(description, false);
12 } 18 }
diff --git a/src/esieequest/model/map/Door.java b/src/esieequest/model/map/Door.java
index 303ea45..122b529 100644
--- a/src/esieequest/model/map/Door.java
+++ b/src/esieequest/model/map/Door.java
@@ -9,10 +9,21 @@ public class Door {
9 9
10 private final Room destination; 10 private final Room destination;
11 11
12 /**
13 * Creates a new Door.
14 *
15 * @param destination
16 * the destination Room
17 */
12 public Door(final Room destination) { 18 public Door(final Room destination) {
13 this.destination = destination; 19 this.destination = destination;
14 } 20 }
15 21
22 /**
23 * Returns the destination Room.
24 *
25 * @return the destination Room
26 */
16 public Room getDestination() { 27 public Room getDestination() {
17 return this.destination; 28 return this.destination;
18 } 29 }
diff --git a/src/esieequest/model/map/HiddenDoor.java b/src/esieequest/model/map/HiddenDoor.java
index 243e09d..e90dc61 100644
--- a/src/esieequest/model/map/HiddenDoor.java
+++ b/src/esieequest/model/map/HiddenDoor.java
@@ -7,6 +7,12 @@ package esieequest.model.map;
7 */