Fix: fixed typos. Add: JavaDoc for Gatherer class

This commit is contained in:
MatteoPellegrino05
2026-04-12 17:00:53 +02:00
parent 53e9c55d7a
commit 2c8f578b88
3 changed files with 26 additions and 14 deletions
@@ -30,7 +30,6 @@ public class Artist extends Character {
*
* @return the string representation of this Artist card
*/
@Override
public String toString() {
return super.toString();
@@ -41,7 +40,6 @@ public class Artist extends Character {
*
* @return a clone of this Artist card
*/
@Override
public Character clone() {
return new Artist(getEra(), getNMin());
@@ -52,7 +50,6 @@ public class Artist extends Character {
*
* @param player the player who receives the card
*/
@Override
public void insert(Player player) {
player.artists.add(this);
@@ -10,13 +10,11 @@ public class Builder extends Character
/**
* The reduction valure provided by this Builder card.
*/
private int reductionValue;
/**
* The prestige value provided by this Builder card.
*/
private int prestigeValue;
/**
@@ -24,7 +22,6 @@ public class Builder extends Character
*
* @return the reduction value of this Builder card
*/
public int getReductionValue() {
return reductionValue;
}
@@ -34,7 +31,6 @@ public class Builder extends Character
*
* @return the prestige value of this Builder card
*/
public int getPrestigeValue() {
return prestigeValue;
}
@@ -48,7 +44,6 @@ public class Builder extends Character
* @param prestigeValue the prestige value of the Builder card
* @throws IllegalArgumentException if {@code reductionValue < 0} or {@code prestigeValue < 0}
*/
public Builder(int Era, int reductionValue, int prestigeValue) throws IllegalArgumentException {
super(Era,CharacterType.BUILDER);
if(reductionValue < 0) {
@@ -72,8 +67,6 @@ public class Builder extends Character
* @param nMin the minimum number of players required for the card
* @throws IllegalArgumentException if {@code reductionValue < 0} or {@code prestigeValue < 0}
*/
public Builder(int Era, int reductionValue, int prestigeValue,int nMin) throws IllegalArgumentException {
super(Era,CharacterType.BUILDER,nMin);
if(reductionValue < 0) {
@@ -92,7 +85,6 @@ public class Builder extends Character
*
* @return the string representation of this Builder card
*/
@Override
public String toString() { return super.toString()+" Reduction Value: " + String.valueOf(reductionValue) + "\n Prestige Value: " + String.valueOf(prestigeValue); }
@@ -101,7 +93,6 @@ public class Builder extends Character
*
* @return a clone of this Builder card
*/
@Override
public Character clone() {
return new Builder(getEra(),getReductionValue(), getPrestigeValue(), getNMin());
@@ -112,7 +103,6 @@ public class Builder extends Character
*
* @param player the player who receives the card
*/
public void insert(Player player) {
player.builders.add(this);
}
@@ -7,24 +7,49 @@ import it.polimi.ingsw.gc14.Model.Player;
public class Gatherer extends Character {
/**
* Creates a Gatherer character card with the specified era.
*
* @param Era gatherers era
* @param Era Gatherers era
*/
public Gatherer(int Era) {
super(Era, CharacterType.GATHERER);
}
/**
* Creates a Gatherer character card with the specified era and minimum number of players.
*
* @param Era the era of the Gatherer card
* @param nMin the minimum number of players required for the card
*/
public Gatherer(int Era, int nMin) {
super(Era, CharacterType.GATHERER,nMin);
}
/**
* Returns the string representation of this Gatherer card.
*
* @return the string representation of this Gatherer card
*/
@Override
public String toString() {
return super.toString();
}
/**
* Creates and returns a copy of this Gatherer card.
*
* @return a clone of this Gatherer card
*/
@Override
public Character clone() {
return new Gatherer(getEra(), getNMin());
}
/**
* Inserts this Gatherer card into the specified player's Gatherer collection.
*
* @param player the player who receives the card
*/
public void insert(Player player) {
player.gatherers.add(this);
}