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.Characters.Builder;
import it.polimi.ingsw.gc14.Model.Player;

import java.util.ArrayList;
import java.util.stream.Collectors;

public class Building8 extends BuildingCard {

    public Building8(int era, int price,int prestigeValue) {
        super(era,price,prestigeValue);
        effectType= EffectType.FINAL;
        effectId=8;
    }
    @Override
    public BuildingCard clone() {
        return new Building8(getEra(),getPrice(),getPrestigeValue());
    }
    @Override
    public void applyEffect(Player player) throws IllegalArgumentException {
        if(!player.buildingCards.contains(this))
            throw new IllegalArgumentException();
        for (Builder builder : player.builders) {
            player.addPrestige(builder.getPrestigeValue() * 2);
        }
    }

}
