From 0c927ba8563b343423b5fa7baad42ad3baaa1984 Mon Sep 17 00:00:00 2001 From: GabrieleRadice <265572328+GabrieleRadice@users.noreply.github.com> Date: Sat, 11 Apr 2026 17:02:07 +0200 Subject: [PATCH] Add: PlayerTest.java Added Javadoc For "FoodValue" And "getFoodValue" + Minor Fixes. --- .../it/polimi/ingsw/gc14/Model/Player.java | 30 ++++++++++++------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/src/main/java/it/polimi/ingsw/gc14/Model/Player.java b/src/main/java/it/polimi/ingsw/gc14/Model/Player.java index 89e268a..0f74820 100644 --- a/src/main/java/it/polimi/ingsw/gc14/Model/Player.java +++ b/src/main/java/it/polimi/ingsw/gc14/Model/Player.java @@ -26,7 +26,7 @@ public class Player { /** * Getter for the private attribute {@link #UserName}. - * @return String + * @return {@code String} - The UserName */ public String getUserName() { return UserName; @@ -34,8 +34,8 @@ public class Player { /** * Counts the total {@link it.polimi.ingsw.gc14.Model.Cards.TribeCards.Character Character Cards} - * the player currently posses. - * @return int + * the player currently possesses. + * @return {@code int} - Total Character Cards. */ public int getTotCharacters() { return Arrays.stream(CharacterType.values()) @@ -47,7 +47,7 @@ public class Player { * Counts the total number of cards of the specified {@link it.polimi.ingsw.gc14.Model.Cards.TribeCards.CharacterType Character Type}. * Character Type must not be {@code null} * @param type the Character Type to be Counted. - * @return int + * @return {@code int} - Total number of cards of given {@code type}. */ public int getNType(CharacterType type) { return switch (type) { @@ -60,41 +60,49 @@ public class Player { }; } /** - * The List containing all {@link BuildingCard Building Cards} the player currently posses. + * The List containing all {@link BuildingCard Building Cards} the player currently possesses. */ public ArrayList buildingCards; /** - * The List containing all {@link Artist Artist Character Cards} the player currently posses. + * The List containing all {@link Artist Artist Character Cards} the player currently possesses. */ public ArrayList artists; /** - * The List containing all {@link Builder Builder Character Cards} the player currently posses. + * The List containing all {@link Builder Builder Character Cards} the player currently possesses. */ public ArrayList builders; /** - * The List containing all {@link Inventor Inventor Character Cards} the player currently posses. + * The List containing all {@link Inventor Inventor Character Cards} the player currently possesses. */ public ArrayList inventors; /** - * The List containing all {@link Gatherer Gatherer Character Cards} the player currently posses. + * The List containing all {@link Gatherer Gatherer Character Cards} the player currently possesses. */ public ArrayList gatherers; /** - * The List containing all {@link Shaman Shaman Character Cards} the player currently posses. + * The List containing all {@link Shaman Shaman Character Cards} the player currently possesses. */ public ArrayList shamans; /** - * The List containing all {@link Hunter Hunter Character Cards} the player currently posses. + * The List containing all {@link Hunter Hunter Character Cards} the player currently possesses. */ public ArrayList hunters; + /** + * The current amount of {@code food} the Player possesses. + */ private int FoodValue; + + /** + * Getter for the private attribute {@link #FoodValue}. + * @return {@code int} - The amount of food the player possesses. + */ public int getFoodValue() { return FoodValue; }