From e03261f02aa98cfed6a0f26d423caa062738a682 Mon Sep 17 00:00:00 2001 From: GabrieleRadice <265572328+GabrieleRadice@users.noreply.github.com> Date: Sun, 12 Apr 2026 16:55:39 +0200 Subject: [PATCH] Add: PlayerTest.java Added Javadoc For "removeFood". --- .../it/polimi/ingsw/gc14/Model/Player.java | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 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 d5f2373..e379d46 100644 --- a/src/main/java/it/polimi/ingsw/gc14/Model/Player.java +++ b/src/main/java/it/polimi/ingsw/gc14/Model/Player.java @@ -114,7 +114,7 @@ public class Player { /** * Getter for the private attribute {@link #PrestigeValue}. - * @return {@code int} - The amount of Prestige the player possesses. + * @return {@code int} - The amount of Prestige the Player possesses. */ public int getPrestigeValue() { return PrestigeValue; @@ -134,13 +134,27 @@ public class Player { * Adds {@code Value} amount of {@code Food} to the Player. * @param Value The amount of {@code Food} to be added. * Should be positive for expected results - * (otherwise the method will subtract {@code abs(Value)}). + * (otherwise the method will subtract the absolute + * value of {@code Value}). * @see #FoodValue */ public void addFood(int Value){ this.FoodValue += Value; } + /** + * Removes {@code Value} amount of {@code Food} from the Player. + * Note: {@link #FoodValue} cannot be negative, so the method will + * return {@code False} if {@code Value} is greater than the + * amount of {@code Food} the Player possesses, {@code False} otherwise. + * @param Value The amount of {@code Food} to be removed. + * Should be positive for expected results + * (otherwise the method will add the absolute + * value of {@code Value}). + * @return {@code Boolean} - {@code True} if {@code Value} is greater than + * the amount of {@code Food} the Player possesses, {@code False} otherwise. + * @see #FoodValue + */ public Boolean removeFood(int Value){ if(Value > this.FoodValue){ return false;