Fix and complete JavaDoc comments

This commit is contained in:
MatteoPellegrino05
2026-05-06 16:59:18 +02:00
parent b40ed99bc1
commit 51718699a3
35 changed files with 390 additions and 54 deletions
@@ -2,6 +2,18 @@ package it.polimi.ingsw.gc14.Model.Cards.Building;
import it.polimi.ingsw.gc14.Model.Player;
/**
* Defines the effect behavior of a building card.
*
* <p>Classes implementing this interface provide the specific effect
* applied to a player when the building card is activated.
*/
public interface BuildingEffect {
public void applyEffect(Player player);
/**
* Applies the building effect to the specified player.
*
* @param player the player affected by the building effect.
*/
void applyEffect(Player player);
}
@@ -1,5 +1,10 @@
package it.polimi.ingsw.gc14.Model.Cards.Building;
/**
* Represents the possible effect types of building cards.
/**
* Represents the possible effect types of building cards.
*/
public enum EffectType {
FINAL, CARD_SET, INVENTOR_PAIR, ON_EVENT, ON_END_TURN, ON_ROUND_END
}
@@ -7,6 +7,11 @@ import it.polimi.ingsw.gc14.Model.Player;
import java.util.HashMap;
/**
* Represents the building card number 10.
*
* <p>This class defines the specific behavior and effects of building card 10.
*/
public class Building10 extends BuildingCard {
/**
@@ -5,6 +5,11 @@ import it.polimi.ingsw.gc14.Model.Cards.BuildingCard;
import it.polimi.ingsw.gc14.Model.Cards.TribeCards.CharacterType;
import it.polimi.ingsw.gc14.Model.Player;
/**
* Represents the building card number 11.
*
* <p>This class defines the specific behavior and effects of building card 11.
*/
public class Building11 extends BuildingCard {
/**
@@ -4,7 +4,13 @@ import it.polimi.ingsw.gc14.Model.Cards.Building.EffectType;
import it.polimi.ingsw.gc14.Model.Cards.BuildingCard;
import it.polimi.ingsw.gc14.Model.Player;
/**
* Represents the building card number 13.
*
* <p>This class defines the specific behavior and effects of building card 13.
*/
public class Building13 extends BuildingCard{
/**
* Creates a Building13 card with the specified era, price, and prestige value.
*
@@ -6,8 +6,16 @@ import it.polimi.ingsw.gc14.Model.PlayableCard;
import it.polimi.ingsw.gc14.Model.Player;
import java.io.Serializable;
import java.util.ArrayList;
/**
* Represents a generic building card in the game.
*
* <p>A building card is a playable card with a price and a specific building
* effect. Concrete building cards extend this class to define their own
* behavior.
*/
public class BuildingCard extends PlayableCard implements Cloneable , BuildingEffect, Serializable {
/**
* The price of this building card.
*/
@@ -1,5 +1,10 @@
package it.polimi.ingsw.gc14.Model.Cards.TribeCards;
/**
* Represents the different types of character cards available in the game.
/**
* Represents the different types of character cards available in the game.
*/
public enum CharacterType {
INVENTOR, BUILDER, GATHERER, ARTIST, SHAMAN, HUNTER
}
@@ -4,12 +4,18 @@ import it.polimi.ingsw.gc14.Model.Cards.TribeCards.Character;
import it.polimi.ingsw.gc14.Model.Cards.TribeCards.CharacterType;
import it.polimi.ingsw.gc14.Model.Player;
/**
* Represents an Artist character card.
*
* <p>An Artist is a specific type of {@link Character} initialized with
* {@link CharacterType#ARTIST}.
*/
public class Artist extends Character {
/**
* Creates an Artist character card with the specified era.
*
* @param Era the era of the Artist card
* @param Era the era of the Artist card.
*/
public Artist(int Era) {
super(Era, CharacterType.ARTIST);
@@ -18,8 +24,8 @@ public class Artist extends Character {
/**
* Creates an Artist character card with the specified Era and minimum number of players required to play it.
*
* @param Era the era of the Artist card
* @param nMin the minimum number of players required for the card
* @param Era the era of the Artist card.
* @param nMin the minimum number of players required for the card.
*/
public Artist(int Era,int nMin) {
super(Era, CharacterType.ARTIST,nMin);
@@ -4,7 +4,14 @@ import it.polimi.ingsw.gc14.Model.Cards.TribeCards.Character;
import it.polimi.ingsw.gc14.Model.Cards.TribeCards.CharacterType;
import it.polimi.ingsw.gc14.Model.Player;
/**
* Represents a Builder character card.
*
* <p>A Builder is a specific type of {@link Character} that provides
* a reduction value when buying building cards.
*/
public class Builder extends Character {
/**
* The reduction value provided by this Builder card.
*/
@@ -4,7 +4,14 @@ import it.polimi.ingsw.gc14.Model.Cards.TribeCards.Character;
import it.polimi.ingsw.gc14.Model.Cards.TribeCards.CharacterType;
import it.polimi.ingsw.gc14.Model.Player;
/**
* Represents a Gatherer character card.
*
* <p>A Gatherer is a specific type of {@link Character} initialized with
* {@link CharacterType#GATHERER}.
*/
public class Gatherer extends Character {
/**
* Creates a Gatherer character card with the specified era.
*
@@ -4,6 +4,12 @@ import it.polimi.ingsw.gc14.Model.Cards.TribeCards.Character;
import it.polimi.ingsw.gc14.Model.Cards.TribeCards.CharacterType;
import it.polimi.ingsw.gc14.Model.Player;
/**
* Represents a Hunter character card.
*
* <p>A Hunter is a specific type of {@link Character} initialized with
* {@link CharacterType#HUNTER}.
*/
public class Hunter extends Character {
/**
@@ -3,6 +3,12 @@ import it.polimi.ingsw.gc14.Model.Cards.TribeCards.Character;
import it.polimi.ingsw.gc14.Model.Cards.TribeCards.CharacterType;
import it.polimi.ingsw.gc14.Model.Player;
/**
* Represents an Inventor character card.
*
* <p>An Inventor is a specific type of {@link Character} initialized with
* {@link CharacterType#INVENTOR}.
*/
public class Inventor extends Character {
/**
* The {@code Icons}'s ID. There are a total of 10 different Icons.
@@ -1,10 +1,15 @@
package it.polimi.ingsw.gc14.Model.Cards.TribeCards.Characters;
import it.polimi.ingsw.gc14.Model.Cards.TribeCard;
import it.polimi.ingsw.gc14.Model.Cards.TribeCards.Character;
import it.polimi.ingsw.gc14.Model.Cards.TribeCards.CharacterType;
import it.polimi.ingsw.gc14.Model.Player;
/**
* Represents a Shaman character card.
*
* <p>A Shaman is a specific type of {@link Character} initialized with
* {@link CharacterType#SHAMAN}.
*/
public class Shaman extends Character {
/**
* The number of star {@code Icons} the card possesses.
@@ -1,5 +1,10 @@
package it.polimi.ingsw.gc14.Model.Cards.TribeCards;
/**
* Represents the different types of event cards available in the game.
/**
* Represents the different types of event cards available in the game.
*/
public enum EventType {
SUSTENANCE, SHAMANIC_RITUAL, CAVE_PAINTINGS, HUNT
}
@@ -10,6 +10,11 @@ import it.polimi.ingsw.gc14.Model.Cards.TribeCards.EventCard;
import it.polimi.ingsw.gc14.Model.Player;
import java.util.ArrayList;
/**
* Represents a Cave Paintings event card.
*
* <p>This class defines the specific behavior of the Cave Paintings event.
*/
public class CavePaintings extends EventCard {
/**
@@ -36,9 +36,9 @@ public class Hunt extends EventCard {
* Each player takes 1 Food and gains Prestige Points for each Hunter in their tribe.
*
* Buildings influence:
* Building 7: you take 1 Food and 1 additional Prestige Point for each Hunter
* Building 7: the player takes 1 Food and 1 additional Prestige Point for each Hunter.
*
* @param playerList contains all the players in the game
* @param playerList the list of all players in the game.
*/
@Override
public void activateEvent (ArrayList <Player> playerList){
@@ -8,6 +8,11 @@ import it.polimi.ingsw.gc14.Model.Cards.TribeCards.EventCard;
import it.polimi.ingsw.gc14.Model.Player;
import java.util.ArrayList;
/**
* Represents a Sustenance event card.
*
* <p>This class defines the specific behavior of the Sustenance event.
*/
public class Sustenance extends EventCard {
/**