diff options
-rw-r--r-- | src/esieequest/controller/commands/InventoryCommand.java | 2 | ||||
-rw-r--r-- | src/esieequest/model/Player.java | 9 | ||||
-rw-r--r-- | src/esieequest/model/Text.java | 5 |
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(", "), |