From 78a3edddf91df4ed773b4ad39461b8e7826c1042 Mon Sep 17 00:00:00 2001
From: MatteoPellegrino05
Date: Wed, 20 May 2026 17:10:57 +0200
Subject: [PATCH] Docs: refine JavaDoc for character card classes
---
.../Model/Cards/TribeCards/Characters/Artist.java | 6 +++---
.../Model/Cards/TribeCards/Characters/Builder.java | 14 ++++++--------
.../Cards/TribeCards/Characters/Gatherer.java | 9 +++++----
.../Model/Cards/TribeCards/Characters/Hunter.java | 13 ++++++++++---
.../Cards/TribeCards/Characters/Inventor.java | 12 +++++++++---
.../Model/Cards/TribeCards/Characters/Shaman.java | 11 ++++++-----
6 files changed, 39 insertions(+), 26 deletions(-)
diff --git a/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Characters/Artist.java b/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Characters/Artist.java
index caf600b..07c8845 100644
--- a/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Characters/Artist.java
+++ b/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Characters/Artist.java
@@ -74,7 +74,8 @@ public class Artist extends Character {
}
/**
- * Inserts this Artist card into the specified player's Artist collection.
+ * Inserts this Artist card into the specified player's Artist collection
+ * and applies any building effects triggered by character set completion.
*
* @param player the player who receives the card.
*/
@@ -84,5 +85,4 @@ public class Artist extends Character {
player.buildingCards.stream().filter(x->x.getEffectId()==0).forEach(x->x.applyEffect(player));
}
-}
-
+}
\ No newline at end of file
diff --git a/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Characters/Builder.java b/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Characters/Builder.java
index 76a0704..ab3f9ea 100644
--- a/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Characters/Builder.java
+++ b/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Characters/Builder.java
@@ -143,13 +143,10 @@ public class Builder extends Character {
}
/**
- * Prints a string representation of this {@code TribeCard}. This specific variation is used in the {@code Game}'s
- * toString to print a more detailed version.
- * Includes:
- *
{@link #reductionValue Reduction Value}
- * {@link #prestigeValue Prestige Value}
- *
- * @return {@code String} - a string representation of this {@code TribeCard}.
+ * Returns a detailed string representation of this {@code Builder} card,
+ * including its reduction value and prestige value.
+ *
+ * @return a detailed string representation of this {@code Builder} card.
* @see it.polimi.ingsw.gc14.Model.Cards.TribeCard TribeCard
* @see it.polimi.ingsw.gc14.Model.Game Game
* @see it.polimi.ingsw.gc14.Model.GamePackage.Board Board
@@ -172,7 +169,8 @@ public class Builder extends Character {
}
/**
- * Inserts this Builder card into the specified player's Builder collection.
+ * Inserts this Builder card into the specified player's Builder collection
+ * and applies any building effects triggered by character set completion.
*
* @param player the player who receives the card.
*/
diff --git a/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Characters/Gatherer.java b/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Characters/Gatherer.java
index 4f5d3d3..f05049a 100644
--- a/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Characters/Gatherer.java
+++ b/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Characters/Gatherer.java
@@ -15,7 +15,7 @@ public class Gatherer extends Character {
/**
* Creates a Gatherer character card with the specified era.
*
- * @param Era Gatherers era.
+ * @param Era the era of the Gatherer card.
*/
public Gatherer(int Era) {
super(Era, CharacterType.GATHERER);
@@ -32,7 +32,7 @@ public class Gatherer extends Character {
}
/**
- * Creates a Gatherer character card with the specified era.
+ * Creates a Gatherer character card with the specified image id and era.
*
* @param idIMG the image identifier of the Gatherer card.
* @param Era the era of the Gatherer card.
@@ -74,7 +74,8 @@ public class Gatherer extends Character {
}
/**
- * Inserts this Gatherer card into the specified player's Gatherer collection.
+ * Inserts this Gatherer card into the specified player's Gatherer collection
+ * and applies any building effects triggered by character set completion.
*
* @param player the player who receives the card.
*/
@@ -82,4 +83,4 @@ public class Gatherer extends Character {
player.gatherers.add(this);
player.buildingCards.stream().filter(x->x.getEffectId()==0).forEach(x->x.applyEffect(player));
}
-}
+}
\ No newline at end of file
diff --git a/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Characters/Hunter.java b/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Characters/Hunter.java
index 314c9f2..80e6b31 100644
--- a/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Characters/Hunter.java
+++ b/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Characters/Hunter.java
@@ -93,11 +93,14 @@ public class Hunter extends Character {
}
/**
- * Prints a string representation of this {@code TribeCard}. This specific variation is used in the {@code Game}'s
- * toString to print a more detailed version.
+ * Returns a detailed string representation of this {@code TribeCard}.
+ * This specific variation is used in the {@code Game}'s
+ * toString to provide a more detailed version.
+ *
* Potentially includes:
*
{@link #icon Icon}
*
+ *
* @return {@code String} - a string representation of this {@code TribeCard}.
* @see it.polimi.ingsw.gc14.Model.Cards.TribeCard TribeCard
* @see it.polimi.ingsw.gc14.Model.Game Game
@@ -125,6 +128,10 @@ public class Hunter extends Character {
/**
* Inserts this Hunter card into the specified player's Hunter collection.
*
+ * If this card has the Hunter icon, the player gains 1 food for each
+ * Hunter currently in their tribe. The method also applies any building
+ * effects triggered by character set completion.
+ *
* @param player the player who receives the card.
*/
@Override
@@ -136,4 +143,4 @@ public class Hunter extends Character {
player.buildingCards.stream().filter(x->x.getEffectId()==0).forEach(x->x.applyEffect(player));
}
-}
+}
\ No newline at end of file
diff --git a/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Characters/Inventor.java b/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Characters/Inventor.java
index 2397506..4563874 100644
--- a/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Characters/Inventor.java
+++ b/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Characters/Inventor.java
@@ -97,11 +97,14 @@ public class Inventor extends Character {
}
/**
- * Prints a string representation of this {@code TribeCard}. This specific variation is used in the {@code Game}'s
- * toString to print a more detailed version.
+ * Returns a detailed string representation of this {@code TribeCard}.
+ * This specific variation is used in the {@code Game}'s toString
+ * to provide a more detailed version.
+ *
*
Includes:
*
{@link #icon Icons's ID}
*
+ *
* @return {@code String} - a string representation of this {@code TribeCard}.
* @see it.polimi.ingsw.gc14.Model.Cards.TribeCard TribeCard
* @see it.polimi.ingsw.gc14.Model.Game Game
@@ -125,6 +128,9 @@ public class Inventor extends Character {
/**
* Inserts this Inventor card into the specified player's Inventor collection.
*
+ * The method also applies the building effects related to inventor pairs
+ * and any building effects triggered by character set completion.
+ *
* @param player the player who receives the card.
*/
@Override
@@ -133,4 +139,4 @@ public class Inventor extends Character {
player.inventors.add(this);
player.buildingCards.stream().filter(x->x.getEffectId()==0).forEach(x->x.applyEffect(player));
}
-}
+}
\ No newline at end of file
diff --git a/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Characters/Shaman.java b/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Characters/Shaman.java
index de53e39..133f7db 100644
--- a/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Characters/Shaman.java
+++ b/src/main/java/it/polimi/ingsw/gc14/Model/Cards/TribeCards/Characters/Shaman.java
@@ -26,7 +26,7 @@ public class Shaman extends Character {
* @return the icon value of this Shaman card.
*/
public int getIcon() {
- return icon;
+ return icon;
}
/**
@@ -90,8 +90,8 @@ public class Shaman extends Character {
}
/**
- * Prints a string representation of this {@code TribeCard}. This specific variation is used in the {@code Game}'s
- * toString to print a more detailed version.
+ * Returns a string representation of this {@code TribeCard}. This specific variation is used in the {@code Game}'s
+ * toString to provide a more detailed version.
*
Includes:
*
{@link #icon Number of stars}
*
@@ -116,7 +116,8 @@ public class Shaman extends Character {
}
/**
- * Inserts this Shaman card into the specified player's Shaman collection.
+ * Inserts this Shaman card into the specified player's Shaman collection
+ * and applies any building effects triggered by character set completion.
*
* @param player the player who receives the card.
*/
@@ -126,4 +127,4 @@ public class Shaman extends Character {
player.shamans.add(this);
player.buildingCards.stream().filter(x->x.getEffectId()==0).forEach(x->x.applyEffect(player));
}
-}
+}
\ No newline at end of file