aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPacien TRAN-GIRARD2014-05-03 18:28:43 +0200
committerPacien TRAN-GIRARD2014-05-03 18:28:43 +0200
commit23c4d7012568277b7985f1b1e633c4b8242f9ddd (patch)
tree3b135bb05e7a80298dab0024fa7b50455f18b724
parent7bd608905ed1be586004621af2a252eafd22c384 (diff)
downloadesieequest-23c4d7012568277b7985f1b1e633c4b8242f9ddd.tar.gz
Add missing inventory weight printing
-rw-r--r--src/esieequest/controller/commands/InventoryCommand.java2
-rw-r--r--src/esieequest/model/Player.java9
-rw-r--r--src/esieequest/model/Text.java5
3 files changed, 14 insertions, 2 deletions
diff --git a/src/esieequest/controller/commands/InventoryCommand.java b/src/esieequest/controller/commands/InventoryCommand.java
index ff7a341..0f95ead 100644
--- a/src/esieequest/controller/commands/InventoryCommand.java
+++ b/src/esieequest/controller/commands/InventoryCommand.java
@@ -13,7 +13,7 @@ public class InventoryCommand implements Executable {
13 @Override 13 @Override
14 public void execute(final String argument, final Game game, final Viewable view) { 14 public void execute(final String argument, final Game game, final Viewable view) {
15 15
16 view.echo(game.getPlayer().listItemsNamesString()); 16 view.echo(game.getPlayer().listItemsNamesString() + game.getPlayer().getWeightString());
17 17
18 } 18 }
19 19
diff --git a/src/esieequest/model/Player.java b/src/esieequest/model/Player.java
index 3851c44..4060367 100644
--- a/src/esieequest/model/Player.java
+++ b/src/esieequest/model/Player.java
@@ -295,4 +295,13 @@ public class Player {
295 return this.nbSteps == this.nbStepsLimit; 295 return this.nbSteps == this.nbStepsLimit;
296 } 296 }
297 297
298 /**
299 * Returns informations about the Player's inventory weight.
300 *
301 * @return informations about the Player's inventory weight
302 */
303 public String getWeightString() {
304 return Text.INVENTORY_WEIGHT_PREFIX.getText() + this.getItemsWeight() + Text.INVENTORY_WEIGHT_SUFFIX.getText();
305 }
306
298} 307}
diff --git a/src/esieequest/model/Text.java b/src/esieequest/model/Text.java
index 7a9bd49..283ccab 100644
--- a/src/esieequest/model/Text.java
+++ b/src/esieequest/model/Text.java
@@ -48,7 +48,10 @@ public enum Text {
48 DIRECTION_SUFFIX("."), 48 DIRECTION_SUFFIX("."),
49 49
50 INVENTORY_PREFIX("Items: "), 50 INVENTORY_PREFIX("Items: "),
51 INVENTORY_SUFFIX("."), 51 INVENTORY_SUFFIX(". "),
52
53 INVENTORY_WEIGHT_PREFIX("Total inventory weight: "),
54 INVENTORY_WEIGHT_SUFFIX("."),
52 55
53 // formatting 56 // formatting
54 LIST_SEPARATOR(", "), 57 LIST_SEPARATOR(", "),