//----------------------------------------------------------------------
//  SPECIFICATION FILE (dealer.h)
//  This module exports CardValType, SuitType, and CardDeckType
//  to randomly deal playing cards.
//  Machine dependency: long ints must be at least 32 bits (4 bytes).
//----------------------------------------------------------------------
#include "rand2.h"

enum CardValType { two, three, four, five, six, seven, eight,
                   nine, ten, jack, queen, king, ace };
enum SuitType    { clubs, diamonds, hearts, spades };

class CardDeckType {
public:
    void ShuffleDeck();
        // POST: All 52 cards have been returned to the deck

    void DealACard( /* out */ CardValType& cardVal,
                    /* out */ SuitType&    suit    );
        // PRE:  At least one card remains in the deck
        // POST: cardVal and suit represent a playing card not
        //       dealt since most recent ShuffleDeck
        //    && This card has been removed from the deck

    int CardsInDeck() const;
        // POST: FCTVAL == number of cards remaining in the deck

    CardDeckType( /* in */ long initSeed );
        // Constructor
        // PRE:  initSeed >= 1
        // POST: Random no. generator has been initialized with initSeed
        //    && The deck has been shuffled
private:
    RandGen cardGen;
    int     cardsRemaining;
    int     card[52];
};

