<commit_before><commit_msg>card pile<commit_after>/**
 *
 */
package com.github.apixandru.games.rummikub;

import java.util.Collections;
import java.util.LinkedList;
import java.util.Queue;

/**
 * @author <NAME>
 * @since Sep 20, 2015
 */
public final class CardPile {

	private final Queue<Card> cards;

	{
		final LinkedList<Card> cards = new LinkedList<Card>();

		for (final Rank rank : Rank.values()) {
			for (final Color color : Color.values()) {
				cards.add(new Card(color, rank));
			}
		}

		// jokers
		cards.add(new Card(null, null));
		cards.add(new Card(null, null));

		Collections.shuffle(cards);

		this.cards = cards;
	}

	/**
	 * @return
	 */
	public int getNumberOfCards() {
		return this.cards.size();
	}

	/**
	 * @return
	 */
	public boolean hasMoreCards() {
		return !this.cards.isEmpty();
	}

	/**
	 * @return
	 */
	public Card nextCard() {
		return this.cards.remove();
	}

}
{'fraction_non_alphanumeric': 0.16371681415929204, 'fraction_numerical': 0.00663716814159292, 'mean_word_length': 3.268867924528302, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5628175', 'n_tokens_mistral': 357, 'n_tokens_neox': 315, 'n_words': 70}