Add: PlayerTest.java Added Javadoc For "FoodValue" And "getFoodValue" + Minor Fixes.

This commit is contained in:
GabrieleRadice
2026-04-11 17:02:07 +02:00
parent 436044ad2a
commit 0c927ba856
@@ -26,7 +26,7 @@ public class Player {
/** /**
* Getter for the private attribute {@link #UserName}. * Getter for the private attribute {@link #UserName}.
* @return String * @return {@code String} - The UserName
*/ */
public String getUserName() { public String getUserName() {
return UserName; return UserName;
@@ -34,8 +34,8 @@ public class Player {
/** /**
* Counts 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. * the player currently possesses.
* @return int * @return {@code int} - Total Character Cards.
*/ */
public int getTotCharacters() { public int getTotCharacters() {
return Arrays.stream(CharacterType.values()) 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}. * 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} * Character Type must not be {@code null}
* @param type the Character Type to be Counted. * @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) { public int getNType(CharacterType type) {
return switch (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 <BuildingCard> buildingCards; public ArrayList <BuildingCard> 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 <Artist> artists; public ArrayList <Artist> 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 <Builder> builders; public ArrayList <Builder> 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 <Inventor> inventors; public ArrayList <Inventor> 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 <Gatherer> gatherers; public ArrayList <Gatherer> 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 <Shaman> shamans; public ArrayList <Shaman> 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 <Hunter> hunters; public ArrayList <Hunter> hunters;
/**
* The current amount of {@code food} the Player possesses.
*/
private int FoodValue; private int FoodValue;
/**
* Getter for the private attribute {@link #FoodValue}.
* @return {@code int} - The amount of food the player possesses.
*/
public int getFoodValue() { public int getFoodValue() {
return FoodValue; return FoodValue;
} }