package solitaire;

final class Card {
    private final Suit suit;
    private final Rank rank;
    private boolean hidden;

    Card(Suit suit, Rank rank) {
	this(suit, rank, true);
    }

    Card(Suit suit, Rank rank, boolean hidden) {
	this.suit = suit;
	this.rank = rank;
	this.hidden = hidden;
    }

    @Override
    public String toString() {
	if (isHidden())
	    return " * ";

	return String.format("%s%2s", suit, rank);
    }

    Rank getRank() {
	return rank;
    }

    Suit getSuit() {
	return suit;
    }

    boolean isHidden() {
	return hidden;
    }

    void reveal() {
	hidden = false;
    }
}
