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.
*
* @return the price of this building card
* @return the price of this building card.
*/
public int getPrice() {
return price;
@@ -46,7 +46,7 @@ public class BuildingCard extends PlayableCard implements Cloneable , BuildingEf
/**
* 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() {
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.
*
* @return the effect identifier of this building card
* @return the effect identifier of this building card.
*/
public int getEffectId() {
return effectId;
@@ -64,7 +64,7 @@ public class BuildingCard extends PlayableCard implements Cloneable , BuildingEf
/**
* 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() {
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.
*
* @param era the era of the building card
* @param price the price of the building card
* @param prestigeValue the prestige value of the building card
* @param era the era of the building card.
* @param price the price of the building card.
* @param prestigeValue the prestige value of the building card.
* @throws IllegalArgumentException if {@code price <= 0} or {@code prestigeValue < 0}
*/
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.
* The effect type is determined from the given effect identifier.
*
* @param effectId the identifier of the effect associated with the building card
* @param era the era of the building card
* @param price the price of the building card
* @param prestigeValue the prestige value of the building card
* @param effectId the identifier of the effect associated with the building card.
* @param era the era of the building card.
* @param price the price of the building card.
* @param prestigeValue the prestige value of the building card.
* @throws IllegalArgumentException if the effect identifier is not valid,
* 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.
*
* @return a clone of this building card
* @return a clone of this building card.
*/
@Override
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
* 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,
* {@code false} otherwise
* {@code false} otherwise.
*/
public boolean buy(Player player) {
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.
*
* @param player the player to whom the effect is applied
* @param player the player to whom the effect is applied.
*/
@Override
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.
*
* @return the string representation of this building card
* @return the string representation of this building card.
*/
@Override
public String toString() {
@@ -18,7 +18,7 @@ public abstract class TribeCard extends PlayableCard {
/**
* 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() {
return isEventCard;
@@ -32,7 +32,7 @@ public abstract class TribeCard extends PlayableCard {
/**
* 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() {
return nMin;
@@ -42,8 +42,8 @@ public abstract class TribeCard extends PlayableCard {
* Creates a tribe card with the specified era and event-card flag.
* The minimum number of players is set to 0.
*
* @param Era the era of the tribe card
* @param isEventCard whether the card is an event card
* @param Era the era of the tribe card.
* @param isEventCard whether the card is an event card.
*/
public TribeCard(int Era,boolean isEventCard) {
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,
* and minimum number of players.
*
* @param Era the era of the tribe card
* @param isEventCard whether the card is an event card
* @param nMin the minimum number of players required for the card
* @param Era the era of the tribe card.
* @param isEventCard whether the card is an event card.
* @param nMin the minimum number of players required for the card.
*/
public TribeCard(int Era,boolean isEventCard,int nMin) {
super(Era);
@@ -66,7 +66,7 @@ public abstract class TribeCard extends PlayableCard {
/**
* Creates and returns a copy of this tribe card.
*
* @return a clone of this tribe card
* @return a clone of this tribe card.
*/
@Override
public abstract TribeCard clone();
@@ -5,7 +5,7 @@ import it.polimi.ingsw.gc14.Model.Player;
/**
* 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}.
*/
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.
*
* @return the type of this character card
* @return the type of this character card.
*/
public CharacterType getType() {
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.
*
* @param Era the era of the character card
* @param type the type of the character card
* @param Era the era of the character card.
* @param type the type of the character card.
*/
public Character(int Era, CharacterType type){
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,
* and minimum number of players.
*
* @param Era the era of the character card
* @param type the type of the character card
* @param nMin the minimum number of players required for the card
* @param Era the era of the character card.
* @param type the type of the character card.
* @param nMin the minimum number of players required for the card.
*/
public Character(int Era, CharacterType type,int 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
* 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
public String toString() {
@@ -63,7 +63,7 @@ public abstract class Character extends TribeCard implements Cloneable {
/**
* Creates and returns a copy of this character card.
*
* @return a clone of this character card
* @return a clone of this character card.
*/
@Override
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.
*
* @param player the player who receives the character card
* @param player the player who receives the character card.
*/
public abstract void insert(Player player);
}
@@ -8,7 +8,7 @@ import java.lang.reflect.Array;
/**
* 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}.
*/
public abstract class EventCard extends TribeCard {
@@ -23,7 +23,7 @@ public abstract class EventCard extends TribeCard {
/**
* 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; }
@@ -34,8 +34,8 @@ public abstract class EventCard extends TribeCard {
/**
* Creates an event card with the specified era and event type.
*
* @param Era the era of the event card
* @param type the type of the event card
* @param Era the era of the event card.
* @param type the type of the event card.
*/
public EventCard(int Era, EventType type) {
super(Era,true);
@@ -48,7 +48,7 @@ public abstract class EventCard extends TribeCard {
/**
* Creates and returns a copy of this event card.
*
* @return a clone of this event card
* @return a clone of this event card.
*/
@Override
public abstract TribeCard clone();
@@ -58,7 +58,7 @@ public abstract class EventCard extends TribeCard {
* The returned string includes the string representation of the superclass
* 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
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.
*
* @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);