From d45490960b97ba81b9ea92355b1f49121db48531 Mon Sep 17 00:00:00 2001 From: Pacien TRAN-GIRARD Date: Wed, 16 Apr 2014 01:14:22 +0200 Subject: Complete JavaDoc --- src/esieequest/controller/Performer.java | 13 +++++++++++++ src/esieequest/model/entities/Player.java | 1 + src/esieequest/model/events/Quest.java | 5 +++++ src/esieequest/model/items/Beamer.java | 8 ++++++-- src/esieequest/model/items/Inventory.java | 7 ++++++- src/esieequest/model/items/KeyCard.java | 6 ++++++ src/esieequest/model/map/Door.java | 11 +++++++++++ src/esieequest/model/map/HiddenDoor.java | 6 ++++++ src/esieequest/model/map/LockedDoor.java | 6 ++++++ src/esieequest/model/map/TrapDoor.java | 6 ++++++ 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 { */ public void newGame() { // this.loadGame(default game); + // TODO this.view.enable(); this.echo(this.game.getWelcomeMessage()); } @@ -68,6 +69,7 @@ class Performer { * Loads a saved game. */ public void loadGame() { + // TODO this.notImplemented(); } @@ -75,6 +77,7 @@ class Performer { * Saves the current game. */ public void saveGame() { + // TODO this.notImplemented(); } @@ -82,6 +85,7 @@ class Performer { * Toggles the sound. */ public void toggleSound() { + // TODO this.notImplemented(); } @@ -142,6 +146,9 @@ class Performer { this.walk(); } + /** + * Increments and checks the number of steps made by the player. + */ private void walk() { this.game.getPlayer().setNbSteps(this.game.getPlayer().getNbSteps() + 1); if (this.game.getPlayer().getNbSteps() == this.game.getPlayer().getMaxNbSteps()) { @@ -220,6 +227,12 @@ class Performer { this.echo(Utils.list(this.game.getPlayer().getInventory().getItemList(), "Items:", "No item in your inventory.")); } + /** + * Performs an action according to the use of an item. + * + * @param itemName + * the item's name + */ public void useItem(final String itemName) { final Item item = this.game.getPlayer().getInventory().getItem(itemName); 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; import esieequest.model.map.Room; /** + * A player. * * @author Pacien TRAN-GIRARD * @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 @@ package esieequest.model.events; +/** + * A quest that can be completed in the game. + * + * @author Pacien TRAN-GIRARD + */ public class Quest { 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 { private Room room; /** - * Creates a Beamer. + * Creates a new Beamer. * * @param description - * @param weight + * the description of the Beamer */ public Beamer(final String description) { super(description, true); } /** + * Returns the memorised Room. + * * @return the room */ public Room getRoom() { @@ -31,6 +33,8 @@ public class Beamer extends Item { } /** + * Sets the Room to memorise. + * * @param room * the room to set */ 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 { * * @param itemName * the item's name - * @return + * @return the weight of the item */ public int getItemWeight(final String itemName) { return this.items.get(itemName).getWeight(); } + /** + * Returns the sum of the weight of all the items. + * + * @return the total weight + */ public int getTotalWeight() { int totalWeight = 0; 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; */ public class KeyCard extends Item { + /** + * Creates a new KeyCard + * + * @param description + * the description of the KeyCard + */ public KeyCard(final String description) { super(description, false); } 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 { private final Room destination; + /** + * Creates a new Door. + * + * @param destination + * the destination Room + */ public Door(final Room destination) { this.destination = destination; } + /** + * Returns the destination Room. + * + * @return the destination Room + */ public Room getDestination() { return this.destination; } 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; */ public class HiddenDoor extends Door { + /** + * Creates a hidden door. + * + * @param destination + * the destination Room. + */ public HiddenDoor(final Room destination) { super(destination); } diff --git a/src/esieequest/model/map/LockedDoor.java b/src/esieequest/model/map/LockedDoor.java index 08a6513..6f5f15e 100644 --- a/src/esieequest/model/map/LockedDoor.java +++ b/src/esieequest/model/map/LockedDoor.java @@ -11,6 +11,12 @@ public class LockedDoor extends Door { private KeyCard keyCard; + /** + * Creates a new locked door. + * + * @param destination + * the destination Room + */ public LockedDoor(final Room destination) { super(destination); } diff --git a/src/esieequest/model/map/TrapDoor.java b/src/esieequest/model/map/TrapDoor.java index b86e8b5..7b8de7e 100644 --- a/src/esieequest/model/map/TrapDoor.java +++ b/src/esieequest/model/map/TrapDoor.java @@ -8,6 +8,12 @@ package esieequest.model.map; */ public class TrapDoor extends Door { + /** + * Creates a new trap door. + * + * @param destination + * the destination Room. + */ public TrapDoor(final Room destination) { super(destination); } -- cgit v1.2.3