Fixed: Javadoc in BuildingCard.java, Character.java, EventCard.java, and TribeCard.java.

This commit is contained in:
MatteoPellegrino05
2026-04-19 12:15:14 +02:00
parent 2e806d3987
commit 2302671a5a
4 changed files with 41 additions and 41 deletions
@@ -17,7 +17,7 @@ public class BuildingCard extends PlayableCard implements Cloneable , BuildingEf
/** /**
* Returns the price of this building card. * Returns the price of this building card.
* *
* @return the price of this building card * @return the price of this building card.
*/ */
public int getPrice() { public int getPrice() {
return price; return price;
@@ -46,7 +46,7 @@ public class BuildingCard extends PlayableCard implements Cloneable , BuildingEf
/** /**
* Returns the prestige value of this building card. * Returns the prestige value of this building card.
* *
* @return the prestige value of this building card * @return the prestige value of this building card.
*/ */
public int getPrestigeValue() { public int getPrestigeValue() {
return prestigeValue; return prestigeValue;
@@ -55,7 +55,7 @@ public class BuildingCard extends PlayableCard implements Cloneable , BuildingEf
/** /**
* Returns the identifier of the effect associated with this building card. * Returns the identifier of the effect associated with this building card.
* *
* @return the effect identifier of this building card * @return the effect identifier of this building card.
*/ */
public int getEffectId() { public int getEffectId() {
return effectId; return effectId;
@@ -64,7 +64,7 @@ public class BuildingCard extends PlayableCard implements Cloneable , BuildingEf
/** /**
* Returns the type of effect associated with this building card. * Returns the type of effect associated with this building card.
* *
* @return the effect type of this building card * @return the effect type of this building card.
*/ */
public EffectType getEffectType() { public EffectType getEffectType() {
return effectType; return effectType;
@@ -73,9 +73,9 @@ public class BuildingCard extends PlayableCard implements Cloneable , BuildingEf
/** /**
* Creates a building card with the specified era, price, and prestige value. * Creates a building card with the specified era, price, and prestige value.
* *
* @param era the era of the building card * @param era the era of the building card.
* @param price the price of the building card * @param price the price of the building card.
* @param prestigeValue the prestige value of the building card * @param prestigeValue the prestige value of the building card.
* @throws IllegalArgumentException if {@code price <= 0} or {@code prestigeValue < 0} * @throws IllegalArgumentException if {@code price <= 0} or {@code prestigeValue < 0}
*/ */
public BuildingCard(int era,int price,int prestigeValue) throws IllegalArgumentException{ public BuildingCard(int era,int price,int prestigeValue) throws IllegalArgumentException{
@@ -100,10 +100,10 @@ public class BuildingCard extends PlayableCard implements Cloneable , BuildingEf
* and prestige value. * and prestige value.
* The effect type is determined from the given effect identifier. * The effect type is determined from the given effect identifier.
* *
* @param effectId the identifier of the effect associated with the building card * @param effectId the identifier of the effect associated with the building card.
* @param era the era of the building card * @param era the era of the building card.
* @param price the price of the building card * @param price the price of the building card.
* @param prestigeValue the prestige value of the building card * @param prestigeValue the prestige value of the building card.
* @throws IllegalArgumentException if the effect identifier is not valid, * @throws IllegalArgumentException if the effect identifier is not valid,
* if {@code price <= 0}, or if {@code prestigeValue < 0} * if {@code price <= 0}, or if {@code prestigeValue < 0}
*/ */
@@ -141,7 +141,7 @@ public class BuildingCard extends PlayableCard implements Cloneable , BuildingEf
/** /**
* Creates and returns a copy of this building card. * Creates and returns a copy of this building card.
* *
* @return a clone of this building card * @return a clone of this building card.
*/ */
@Override @Override
public BuildingCard clone() public BuildingCard clone()
@@ -156,9 +156,9 @@ public class BuildingCard extends PlayableCard implements Cloneable , BuildingEf
* If the purchase succeeds, the card is added to the player's building cards * If the purchase succeeds, the card is added to the player's building cards
* and marked as bought. * and marked as bought.
* *
* @param player the player attempting to buy the building card * @param player the player attempting to buy the building card.
* @return {@code true} if the building card is successfully bought, * @return {@code true} if the building card is successfully bought,
* {@code false} otherwise * {@code false} otherwise.
*/ */
public boolean buy(Player player) { public boolean buy(Player player) {
if( bought || !player.removeFood(getPrice())) if( bought || !player.removeFood(getPrice()))
@@ -171,7 +171,7 @@ public class BuildingCard extends PlayableCard implements Cloneable , BuildingEf
/** /**
* Applies the effect of this building card to the specified player. * Applies the effect of this building card to the specified player.
* *
* @param player the player to whom the effect is applied * @param player the player to whom the effect is applied.
*/ */
@Override @Override
public void applyEffect(Player player){}; public void applyEffect(Player player){};
@@ -179,7 +179,7 @@ public class BuildingCard extends PlayableCard implements Cloneable , BuildingEf
/** /**
* Returns the string representation of this building card. * Returns the string representation of this building card.
* *
* @return the string representation of this building card * @return the string representation of this building card.
*/ */
@Override @Override
public String toString() { public String toString() {
@@ -18,7 +18,7 @@ public abstract class TribeCard extends PlayableCard {
/** /**
* Returns whether this tribe card is an event card. * Returns whether this tribe card is an event card.
* *
* @return {@code true} if this card is an event card, {@code false} otherwise * @return {@code true} if this card is an event card, {@code false} otherwise.
*/ */
public boolean IsEventCard() { public boolean IsEventCard() {
return isEventCard; return isEventCard;
@@ -32,7 +32,7 @@ public abstract class TribeCard extends PlayableCard {
/** /**
* Returns the minimum number of players required for this tribe card. * Returns the minimum number of players required for this tribe card.
* *
* @return the minimum number of players required for this tribe card * @return the minimum number of players required for this tribe card.
*/ */
public int getNMin() { public int getNMin() {
return nMin; return nMin;
@@ -42,8 +42,8 @@ public abstract class TribeCard extends PlayableCard {
* Creates a tribe card with the specified era and event-card flag. * Creates a tribe card with the specified era and event-card flag.
* The minimum number of players is set to 0. * The minimum number of players is set to 0.
* *
* @param Era the era of the tribe card * @param Era the era of the tribe card.
* @param isEventCard whether the card is an event card * @param isEventCard whether the card is an event card.
*/ */
public TribeCard(int Era,boolean isEventCard) { public TribeCard(int Era,boolean isEventCard) {
this(Era,isEventCard,0); this(Era,isEventCard,0);
@@ -53,9 +53,9 @@ public abstract class TribeCard extends PlayableCard {
* Creates a tribe card with the specified era, event-card flag, * Creates a tribe card with the specified era, event-card flag,
* and minimum number of players. * and minimum number of players.
* *
* @param Era the era of the tribe card * @param Era the era of the tribe card.
* @param isEventCard whether the card is an event card * @param isEventCard whether the card is an event card.
* @param nMin the minimum number of players required for the card * @param nMin the minimum number of players required for the card.
*/ */
public TribeCard(int Era,boolean isEventCard,int nMin) { public TribeCard(int Era,boolean isEventCard,int nMin) {
super(Era); super(Era);
@@ -66,7 +66,7 @@ public abstract class TribeCard extends PlayableCard {
/** /**
* Creates and returns a copy of this tribe card. * Creates and returns a copy of this tribe card.
* *
* @return a clone of this tribe card * @return a clone of this tribe card.
*/ */
@Override @Override
public abstract TribeCard clone(); public abstract TribeCard clone();
@@ -5,7 +5,7 @@ import it.polimi.ingsw.gc14.Model.Player;
/** /**
* Abstract base class for all character cards. * Abstract base class for all character cards.
* A Character is a {@link TribeCard} that is not an event card and is associated * A Character is a {@link TribeCard} that is not an event card and is associated.
* with a specific {@link CharacterType}. * with a specific {@link CharacterType}.
*/ */
public abstract class Character extends TribeCard implements Cloneable { public abstract class Character extends TribeCard implements Cloneable {
@@ -18,7 +18,7 @@ public abstract class Character extends TribeCard implements Cloneable {
/** /**
* Returns the type of this character card. * Returns the type of this character card.
* *
* @return the type of this character card * @return the type of this character card.
*/ */
public CharacterType getType() { public CharacterType getType() {
return type; return type;
@@ -27,8 +27,8 @@ public abstract class Character extends TribeCard implements Cloneable {
/** /**
* Creates a character card with the specified era and character type. * Creates a character card with the specified era and character type.
* *
* @param Era the era of the character card * @param Era the era of the character card.
* @param type the type of the character card * @param type the type of the character card.
*/ */
public Character(int Era, CharacterType type){ public Character(int Era, CharacterType type){
super(Era,false ); super(Era,false );
@@ -39,9 +39,9 @@ public abstract class Character extends TribeCard implements Cloneable {
* Creates a character card with the specified era, character type, * Creates a character card with the specified era, character type,
* and minimum number of players. * and minimum number of players.
* *
* @param Era the era of the character card * @param Era the era of the character card.
* @param type the type of the character card * @param type the type of the character card.
* @param nMin the minimum number of players required for the card * @param nMin the minimum number of players required for the card.
*/ */
public Character(int Era, CharacterType type,int nMin){ public Character(int Era, CharacterType type,int nMin){
super(Era,false ,nMin); super(Era,false ,nMin);
@@ -53,7 +53,7 @@ public abstract class Character extends TribeCard implements Cloneable {
* The returned string includes the string representation of the superclass * The returned string includes the string representation of the superclass
* and the string representation of the character type. * and the string representation of the character type.
* *
* @return the string representation of this character card * @return the string representation of this character card.
*/ */
@Override @Override
public String toString() { public String toString() {
@@ -63,7 +63,7 @@ public abstract class Character extends TribeCard implements Cloneable {
/** /**
* Creates and returns a copy of this character card. * Creates and returns a copy of this character card.
* *
* @return a clone of this character card * @return a clone of this character card.
*/ */
@Override @Override
public abstract Character clone(); public abstract Character clone();
@@ -71,7 +71,7 @@ public abstract class Character extends TribeCard implements Cloneable {
/** /**
* Inserts this character card into the appropriate collection of the specified player. * Inserts this character card into the appropriate collection of the specified player.
* *
* @param player the player who receives the character card * @param player the player who receives the character card.
*/ */
public abstract void insert(Player player); public abstract void insert(Player player);
} }
@@ -8,7 +8,7 @@ import java.lang.reflect.Array;
/** /**
* Abstract base class for all event cards. * Abstract base class for all event cards.
* An EventCard is a {@link TribeCard} marked as an event card and associated * An EventCard is a {@link TribeCard} marked as an event card and associated.
* with a specific {@link EventType}. * with a specific {@link EventType}.
*/ */
public abstract class EventCard extends TribeCard { public abstract class EventCard extends TribeCard {
@@ -23,7 +23,7 @@ public abstract class EventCard extends TribeCard {
/** /**
* Returns the type of this event card. * Returns the type of this event card.
* *
* @return the type of this event card * @return the type of this event card.
*/ */
public EventType getType() { return type; } public EventType getType() { return type; }
@@ -34,8 +34,8 @@ public abstract class EventCard extends TribeCard {
/** /**
* Creates an event card with the specified era and event type. * Creates an event card with the specified era and event type.
* *
* @param Era the era of the event card * @param Era the era of the event card.
* @param type the type of the event card * @param type the type of the event card.
*/ */
public EventCard(int Era, EventType type) { public EventCard(int Era, EventType type) {
super(Era,true); super(Era,true);
@@ -48,7 +48,7 @@ public abstract class EventCard extends TribeCard {
/** /**
* Creates and returns a copy of this event card. * Creates and returns a copy of this event card.
* *
* @return a clone of this event card * @return a clone of this event card.
*/ */
@Override @Override
public abstract TribeCard clone(); public abstract TribeCard clone();
@@ -58,7 +58,7 @@ public abstract class EventCard extends TribeCard {
* The returned string includes the string representation of the superclass * The returned string includes the string representation of the superclass
* and the string representation of the event type. * and the string representation of the event type.
* *
* @return the string representation of this event card * @return the string representation of this event card.
*/ */
@Override @Override
public String toString() { public String toString() {
@@ -68,7 +68,7 @@ public abstract class EventCard extends TribeCard {
/** /**
* Activates the effect of this event card on the specified list of players. * Activates the effect of this event card on the specified list of players.
* *
* @param playerList the list of players affected by the event * @param playerList the list of players affected by the event.
*/ */
public abstract void activateEvent (ArrayList <Player> playerList); public abstract void activateEvent (ArrayList <Player> playerList);