Coverage Summary for Class: Gatherer (it.polimi.ingsw.gc14.Model.Cards.TribeCards.Characters)
| Class |
Class, %
|
Method, %
|
Line, %
|
| Gatherer |
100%
(1/1)
|
87.5%
(7/8)
|
88.9%
(8/9)
|
package it.polimi.ingsw.gc14.Model.Cards.TribeCards.Characters;
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.
*
* @param Era the era of the Gatherer card.
*/
public Gatherer(int Era) {
super(Era, CharacterType.GATHERER);
}
/**
* Creates a Gatherer character card with the specified era and minimum number of players.
*
* @param Era the era of the Gatherer card.
* @param nMin the minimum number of players required for the card.
*/
public Gatherer(int Era, int nMin) {
super(Era, CharacterType.GATHERER,nMin);
}
/**
* Creates a Gatherer character card with the specified image id and era.
*
* @param idIMG the image identifier of the Gatherer card.
* @param Era the era of the Gatherer card.
*/
public Gatherer(String idIMG,int Era) {
super(idIMG,Era, CharacterType.GATHERER);
}
/**
* Creates a Gatherer character card with the specified image id, era and
* minimum number of players.
*
* @param idIMG the image identifier of the Gatherer card.
* @param Era the era of the Gatherer card.
* @param nMin the minimum number of players required for the card.
*/
public Gatherer(String idIMG,int Era, int nMin) {
super(idIMG,Era, CharacterType.GATHERER,nMin);
}
/**
* Creates and returns a copy of this Gatherer card.
*
* @return a clone of this Gatherer card.
*/
@Override
public Character clone() {
return new Gatherer(getIdIMG(),getEra(), getNMin());
}
/**
* Inserts this Gatherer card into the specified player's Gatherer collection
* and applies any building effects triggered by character set completion.
*
* @param player the player who receives the card.
*/
@Override
public void insert(Player player) {
player.getGatherers().add(this);
player.getBuildingCards().stream().filter(x->x.getEffectId()==0).forEach(x->x.applyEffect(player));
}
@Override
public String toStringPlayer() {
return "\uD83C\uDF56";
}
@Override
public String toStringBoard() {
return "GATHERER";
}
}