All Downloads are FREE. Search and download functionalities are using the official Maven repository.

za.co.knowles.pokewhat.domain.Deck Maven / Gradle / Ivy

package za.co.knowles.pokewhat.domain;

import za.co.knowles.pokewhat.domain.lookup.ERank;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class Deck {
    private final List cards;

    public Deck() {
        cards = new ArrayList<>(ERank.FULL_DECK);
        Collections.shuffle(cards);
    }

    public Deck(List cards) {
        this.cards =  new ArrayList<>(cards);
    }

    public Card takeCard() {
        return cards.remove(0);
    }

    public int count() {
        return cards.size();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy