Coverage Summary for Class: Building1 (it.polimi.ingsw.gc14.Model.Cards.Building.Effects)
| Class |
Class, %
|
Method, %
|
Line, %
|
| Building1 |
100%
(1/1)
|
83.3%
(5/6)
|
91.7%
(11/12)
|
package it.polimi.ingsw.gc14.Model.Cards.Building.Effects;
import it.polimi.ingsw.gc14.Model.Cards.Building.EffectType;
import it.polimi.ingsw.gc14.Model.Cards.BuildingCard;
import it.polimi.ingsw.gc14.Model.Cards.TribeCards.CharacterType;
/**
* Building effect that grants a discount of 1 food during the Sustenance Event
* for each character of the indicated type present in the player's tribe.
*/
public class Building1 extends BuildingCard {
/**
* Character type involved in the building effect.
*/
private final CharacterType icon ;
/**
* Returns the character type associated with this building effect.
*
* @return the character type associated with this building effect.
*/
public CharacterType getIcon() {return icon;}
/**
* Creates a building with the specified era, price, prestige value
* and character type involved in its effect.
*
* @param era the game era of the building.
* @param price the price in food of the building.
* @param prestigeValue the number of Prestige Points gained from this building at the end of the game.
* @param icon the character type used by the building effect.
*/
public Building1(int era, int price,int prestigeValue, CharacterType icon) {
super(era,price,prestigeValue);
effectType = EffectType.ON_EVENT;
effectId = 1;
this.icon = icon;
}
/**
* Creates a building with the specified image identifier, era, price,
* prestige value and character type involved in its effect.
*
* @param idIMG the image identifier of the building.
* @param era the game era of the building.
* @param price the price in food of the building.
* @param prestigeValue the number of Prestige Points gained from this building at the end of the game.
* @param icon the character type used by the building effect.
*/
public Building1(String idIMG,int era, int price,int prestigeValue, CharacterType icon) {
super(idIMG,era,price,prestigeValue);
effectType = EffectType.ON_EVENT;
effectId = 1;
this.icon = icon;
}
/**
* Creates a new building instance with the same configuration values
* as this card.
*
* @return a new building card with the same base properties and icon.
*/
@Override
public BuildingCard clone() {
return new Building1(getIdIMG(),getEra(),getPrice(),getPrestigeValue(),getIcon());
}
@Override
public String toStringBoard() {
return super.toStringBoard() + " (Icon:" + this.icon.toString().substring(0, 3) + ")";
}
@Override
public String toStringPlayer() {
return super.toStringPlayer() + " (Icon:" + this.icon.toString().substring(0, 3) + ")";
}
}