Add: Javadoc for EventCard

This commit is contained in:
MatteoPellegrino05
2026-04-18 18:20:46 +02:00
parent 2aca523bf0
commit 3abc0e14b8
@@ -6,13 +6,37 @@ import it.polimi.ingsw.gc14.Model.Player;
import java.util.ArrayList; import java.util.ArrayList;
import java.lang.reflect.Array; 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
* with a specific {@link EventType}.
*/
public abstract class EventCard extends TribeCard { public abstract class EventCard extends TribeCard {
// Getters // Getters
/**
* The specific type of this event card.
*/
private EventType type; private EventType type;
/**
* Returns the type of this event card.
*
* @return the type of this event card
*/
public EventType getType() { return type; } public EventType getType() { return type; }
// End getters // End getters
// Constructors // Constructors
/**
* 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
*/
public EventCard(int Era, EventType type) { public EventCard(int Era, EventType type) {
super(Era,true); super(Era,true);
this.type = type; this.type = type;
@@ -20,15 +44,34 @@ public abstract class EventCard extends TribeCard {
// End Constructors // End Constructors
// Function // Function
/**
* Creates and returns a copy of this event card.
*
* @return a clone of this event card
*/
@Override @Override
public abstract TribeCard clone(); public abstract TribeCard clone();
/**
* Returns the string representation of this event card.
* 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
*/
@Override @Override
public String toString() { public String toString() {
return super.toString()+" "+type.toString(); return super.toString()+" "+type.toString();
} }
/**
* Activates the effect of this event card on the specified list of players.
*
* @param playerList the list of players affected by the event
*/
public abstract void activateEvent (ArrayList <Player> playerList); public abstract void activateEvent (ArrayList <Player> playerList);
// End Functions // End Functions
} }