package solitaire;

import java.util.Collections;
import java.util.LinkedList;
import java.util.List;

final class Stock {
    private final List<Card> cards;

    Stock() {
	this.cards = new LinkedList<>();

	for (Suit s : Suit.SUITS)
	    for (Rank r : Rank.RANKS)
		cards.add(new Card(s, r));

	Collections.shuffle(cards);
    }

    Card draw() {
	return cards.removeLast();
    }

    boolean isEmpty() {
	return cards.isEmpty();
    }

    @Override
    public String toString() {
	if (isEmpty())
	    return "{   }";

	return "{ * }";
    }
}
