docs: refine JavaDoc for model, board and order classes

This commit is contained in:
MatteoPellegrino05
2026-05-20 17:42:42 +02:00
parent 78a3edddf9
commit b01ffd62b8
11 changed files with 63 additions and 45 deletions
@@ -16,7 +16,7 @@ import java.io.Serializable;
*/
public class BuildingCard extends PlayableCard implements Cloneable , BuildingEffect, Serializable {
/**
/**
* The price of this building card.
*/
private int price;
@@ -102,8 +102,10 @@ 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 image identifier, era, price,
* and prestige value.
*
* @param idIMG the image identifier 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.
@@ -160,7 +162,7 @@ public class BuildingCard extends PlayableCard implements Cloneable , BuildingEf
this.effectType=EffectType.ON_EVENT;
break;
case 12:
this.effectType=EffectType.ON_ROUND_END;
this.effectType=EffectType.ON_ROUND_END;
break;
default:
throw new IllegalArgumentException();
@@ -227,10 +229,12 @@ public class BuildingCard extends PlayableCard implements Cloneable , BuildingEf
/**
* Attempts to buy this building card for the specified player.
* The purchase succeeds only if the card has not already been bought
* and the player can pay its price in Food.
* If the purchase succeeds, the card is added to the player's building cards
* and marked as bought.
*
* <p>The effective cost is reduced by the total reduction value provided
* by the player's Builder cards, without dropping below zero. The purchase
* succeeds only if the card has not already been bought and the player can
* pay the resulting amount of Food. If successful, the card is added to
* the player's building cards and marked as bought.
*
* @param player the player attempting to buy the building card.
* @return {@code true} if the building card is successfully bought,
@@ -253,9 +257,12 @@ public class BuildingCard extends PlayableCard implements Cloneable , BuildingEf
}
/**
* Applies the effect of this building card to the specified player.
* Default implementation of the building effect.
*
* @param player the player to whom the effect is applied.
* <p>This method does not perform any operation and can be overridden
* by specific building cards that define an active effect.
*
* @param player the player to whom the effect may be applied.
*/
@Override
public void applyEffect(Player player){};
@@ -269,4 +276,4 @@ public class BuildingCard extends PlayableCard implements Cloneable , BuildingEf
public String toString() {
return "⎕:" + " ID:" + String.valueOf(getEffectId())+ " $:"+String.valueOf(getPrice())+" PV:"+String.valueOf(getPrestigeValue());
}
}
}
@@ -5,7 +5,8 @@ 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.
*
* <p>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 {
@@ -77,8 +78,6 @@ public abstract class Character extends TribeCard implements Cloneable {
/**
* Returns the string representation of this character card.
* 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.
*/
@@ -89,8 +88,8 @@ public abstract class Character extends TribeCard implements Cloneable {
/**
* Prints a string representation of this {@code Character}. This specific variation is used in the {@code Game}'s
* toString to print a more detailed version.
* Returns a string representation of this {@code Character}. This specific variation is used in the {@code Game}'s
* toString to provide a more detailed version.
* <p>Includes:
* <li>{@link it.polimi.ingsw.gc14.Model.Cards.TribeCards.CharacterType Type}
* </p>
@@ -118,4 +117,4 @@ public abstract class Character extends TribeCard implements Cloneable {
* @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 {
@@ -100,6 +100,4 @@ public abstract class EventCard extends TribeCard {
public abstract void activateEvent (ArrayList <Player> playerList);
// End Functions
}
}