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 Hunter extends Character {
    private boolean icon;

    /**
     * Returns whether this Hunter card has the icon.
     *
     * @return {@code true} if this Hunter card has the icon, {@code false} otherwise.
     */
    public boolean getIcon() {
        return icon;
    }

    /**
     * Creates a Hunter character card with the specified era and icon value.
     *
     * @param Era the era of the Hunter card.
     * @param icon the icon value of the Hunter card.
     */
    public Hunter(int Era, boolean icon) {
        super(Era, CharacterType.HUNTER);
        this.icon = icon;
    }

    /**
     * Creates a Hunter character card with the specified era, icon value,
     * and minimum number of players.
     *
     * @param Era the era of the Hunter card.
     * @param icon the icon value of the Hunter card.
     * @param nMin the minimum number of players required for the card.
     */
    public Hunter(int Era, boolean icon, int nMin) {
        super(Era, CharacterType.HUNTER,nMin);
        this.icon = icon;
    }

    /**
     * Returns the string representation of this Hunter card.
     *
     * @return the string representation of this Hunter card.
     */
    @Override
    public String toString() {
        return super.toString() + "Icon: " + String.valueOf(icon);
    }

    /**
     * Creates and returns a copy of this Hunter card.
     *
     * @return a clone of this Hunter card.
     */
    @Override
    public Character clone() {
        return new Hunter(getEra(), getIcon(), getNMin());
    }

    /**
     * Inserts this Hunter card into the specified player's Hunter collection.
     *
     * @param player the player who receives the card.
     */
    @Override
    public void insert(Player player) {
        player.hunters.add(this);
    }

}
