class Player {
        // Receive a card from the dealer.
    public void takeCard(Card c){
        getHand().add(c);
    }

        // Play the next card from the hand. Return null if
        // we have no more cards.
    public Card playCard(){
        if(numCards() > 0){
            // We have at least one card.
            return getHand().getNextCard();
        }
        else{
            return null;
        }
    }

        // Add the cards from the pile to the hand.
    public void takePile(Pile p){
        getHand().addPile(p);
    }

    private int numCards(){
        return getHand().numCards();
    }

    private Hand getHand(){
        return hand;
    }

    // A collection to hold the player's cards.
    private Hand hand = new Hand();
}
