Coverage Summary for Class: Artist (it.polimi.ingsw.gc14.Model.Cards.TribeCards.Characters)

Class Class, % Method, % Line, %
Artist 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 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.
      */
     public Artist(int Era) {
         super(Era, CharacterType.ARTIST);
     }
 
     /**
      * 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.
      */
     public Artist(int Era,int nMin) {
         super(Era, CharacterType.ARTIST,nMin);
     }
 
     /**
      * Creates an Artist character card with the specified image id and era.
      *
      * @param idIMG the image identifier of the Artist card.
      * @param Era the era of the Artist card.
      */
     public Artist(String idIMG,int Era) {
         super(idIMG,Era, CharacterType.ARTIST);
     }
 
     /**
      * Creates an Artist character card with the specified image id, era and
      * minimum number of players required to play it.
      *
      * @param idIMG the image identifier of the Artist card.
      * @param Era the era of the Artist card.
      * @param nMin the minimum number of players required for the card.
      */
     public Artist(String idIMG,int Era,int nMin) {
         super(idIMG,Era, CharacterType.ARTIST,nMin);
     }
 
     /**
      * Creates and returns a copy of this Artist card.
      *
      * @return a clone of this Artist card.
      */
     @Override
     public Character clone() {
         return new Artist(getIdIMG(),getEra(), getNMin());
     }
 
     /**
      * Inserts this Artist card into the specified player's Artist 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.getArtists().add(this);
         player.getBuildingCards().stream().filter(x->x.getEffectId()==0).forEach(x->x.applyEffect(player));
     }
 
     @Override
     public String toStringPlayer() {
         return "\uD83C\uDFA8";
     }
 
     @Override
     public String toStringBoard() {
         return "ARTIST";
     }
 
 }