Coverage Summary for Class: EventCard (it.polimi.ingsw.gc14.Model.Cards.TribeCards)
| Class |
Class, %
|
Method, %
|
Line, %
|
| EventCard |
100%
(1/1)
|
100%
(3/3)
|
100%
(5/5)
|
package it.polimi.ingsw.gc14.Model.Cards.TribeCards;
import it.polimi.ingsw.gc14.Model.Cards.TribeCard;
import it.polimi.ingsw.gc14.Model.Player;
import java.util.ArrayList;
/**
* 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 {
/**
* The specific type of this event card.
*/
private final EventType type;
/**
* Returns the type of this event card.
*
* @return the type of this event card.
*/
public EventType getType() { return type; }
/**
* 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) {
super(era, true);
this.type = type;
}
/**
* Creates an event card with the specified image id, era and event type.
*
* @param idIMG the image identifier of the event card.
* @param era the era of the event card.
* @param type the type of the event card.
*/
public EventCard(String idIMG, int era, EventType type) {
super(idIMG, era, true);
this.type = type;
}
/**
* Creates and returns a copy of this event card.
*
* @return a clone of this event card.
*/
@Override
public abstract TribeCard clone();
/**
* 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);
}