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;

public class Inventor extends Character {
    private int icon;

    /**
     *
     * @return Inventor Specific Symbol
     */
    public int Icon() {
        return icon;
    }

    /**
     *
     * @param Era inventor era
     * @param icon inventor symbol
     * @throws IllegalArgumentException
     */
    public Inventor(int Era,int icon) throws IllegalArgumentException {
        super(Era, CharacterType.INVENTOR);
        if(icon<0 || icon>9)
            throw new IllegalArgumentException();
        this.icon = icon;
    }
    public Inventor(int Era,int icon,int nMin) throws IllegalArgumentException {
        super(Era, CharacterType.INVENTOR,nMin);
        if(icon<0 || icon>9)
            throw new IllegalArgumentException();
        this.icon = icon;
    }
    @Override
    public String toString() {
        return  super.toString() + " Symbol:" + String.valueOf(icon);
    }

    @Override
    public Character clone()  {
        return new Inventor(getEra(),icon, getNMin());
    }
    @Override
    public void insert(Player player) {
        player.inventors.add(this);
    }
}
