From 47bf2f3c44eaf915bce1fb62ebeb293f4a4d17dc Mon Sep 17 00:00:00 2001 From: GabrieleRadice <265572328+GabrieleRadice@users.noreply.github.com> Date: Sat, 11 Apr 2026 16:33:46 +0200 Subject: [PATCH] Add: PlayerTest.java Added Javadoc For "getNType" --- src/main/java/it/polimi/ingsw/gc14/Model/Player.java | 11 +++++++++-- 1 file changed, 9 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 7269f2c..32785a0 100644 --- a/src/main/java/it/polimi/ingsw/gc14/Model/Player.java +++ b/src/main/java/it/polimi/ingsw/gc14/Model/Player.java @@ -22,7 +22,7 @@ public class Player { * exceed {@link #MAX_VALUE} otherwise an {@link IllegalArgumentException} will be thrown * when the {@link #Player(String) constructor} is called. */ - private String UserName; + private final String UserName; /** * Getter for the private attribute {@link #UserName}. @@ -33,7 +33,7 @@ public class Player { } /** - * Returns the total {@link it.polimi.ingsw.gc14.Model.Cards.TribeCards.Character Character Cards} + * Counts the total {@link it.polimi.ingsw.gc14.Model.Cards.TribeCards.Character Character Cards} * the player currently posses. * @return int */ @@ -42,6 +42,13 @@ public class Player { .mapToInt(this::getNType) .sum(); } + + /** + * 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 + */ public int getNType(CharacterType type) { return switch (type) { case ARTIST -> artists.size();