package solitaire;

import java.util.LinkedList;
import java.util.List;
import java.util.stream.Collectors;

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

    Waste() {
	cards = new LinkedList<>();
    }

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

	return cards.stream().map(String::valueOf).collect(Collectors.joining("|", "[", "]"));
    }

    void add(Card card) {
	cards.add(card);
    }

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

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