Add: Added Totems.java Enum And Relevant Attribute "totem", Getter "getTotem" and "setTotem" Methods In Player.java.

Add: Added Relative Javadoc.
This commit is contained in:
GabrieleRadice
2026-05-13 16:06:20 +02:00
parent 7cc993db43
commit a06b3f7968
2 changed files with 29 additions and 0 deletions
@@ -20,6 +20,12 @@ public class Player implements Serializable {
*/
private static final int MAX_VALUE = 32;
/**
* Identifier for the {@code Player} when displaying the game through the GUI.
* @see Totems
*/
private Totems totem;
// region Getters
/**
* Unique string identifier for players; must not be {@code null} and must not
@@ -124,6 +130,15 @@ public class Player implements Serializable {
public int getPrestigeValue() {
return PrestigeValue;
}
/**
* Getter for the private attribute {@link #totem Totem}.
* @return {@code Totems} - The Totem identifier for the Player.
* @see Totems
*/
public Totems getTotem() {
return totem;
}
// endregion getters
// region Setters
@@ -186,6 +201,14 @@ public class Player implements Serializable {
this.PrestigeValue -= Value;
}
/**
* Setter for the private attribute {@link #totem Totem}.
* @see Totems
*/
private void setTotem(Totems totem){
this.totem = totem;
}
// endregion setters
// region Constructors
@@ -216,6 +239,7 @@ public class Player implements Serializable {
this.buildingCards = new ArrayList<>();
this.FoodValue = 0;
this.PrestigeValue = 0;
this.totem = null;
}
// endregion constructors
@@ -0,0 +1,5 @@
package it.polimi.ingsw.gc14.Model;
public enum Totems {
YELLOW, BLUE, ORANGE, WHITE, PURPLE
}