package it.polimi.ingsw.gc14.Model.Cards;

import it.polimi.ingsw.gc14.Model.Cards.TribeCards.Character;
import it.polimi.ingsw.gc14.Model.PlayableCard;
import java.io.Serializable;


/**
 * Abstract base class for all tribe cards.
 * A TribeCard is a {@link PlayableCard} that may either be an event card
 * or a non-event card, and may optionally specify a minimum number of players.
 */
public abstract class TribeCard extends PlayableCard implements Serializable {

    /**
     * Indicates whether this tribe card is an event card.
     */
    private boolean isEventCard;

    /**
     * Returns whether this tribe card is an event card.
     *
     * @return {@code true} if this card is an event card, {@code false} otherwise.
     */
    public boolean IsEventCard() {
        return isEventCard;
    }

    /**
     * The minimum number of players required for this tribe card.
     */
    private int nMin=0;

    /**
     * Returns the minimum number of players required for this tribe card.
     *
     * @return the minimum number of players required for this tribe card.
     */
    public int getNMin() {
        return nMin;
    }

    /**
     * Creates a tribe card with the specified era and event-card flag.
     * The minimum number of players is set to 0.
     *
     * @param Era the era of the tribe card.
     * @param isEventCard whether the card is an event card.
     */
    public TribeCard(int Era,boolean isEventCard) {
        this(Era,isEventCard,0);
    }

    /**
     * Creates a tribe card with the specified era, event-card flag,
     * and minimum number of players.
     *
     * @param Era the era of the tribe card.
     * @param isEventCard whether the card is an event card.
     * @param nMin the minimum number of players required for the card.
     */
    public TribeCard(int Era,boolean isEventCard,int nMin) {
        super(Era);
        this.nMin=nMin;
        this.isEventCard=isEventCard;
    }

    /**
     * Creates and returns a copy of this tribe card.
     *
     * @return a clone of this tribe card.
     */
    @Override
    public abstract TribeCard clone();
}
