#ifndef HAND_H #define HAND_H #include "Card.h" #include "NodeList.h" #include "VariousExceptions.h" class Hand { public: /** * Default Constructor * * Starts with an empty List for representing an empty hand. * and an empty array of fingers for the four suits. * */ Hand(); /** * Copy Constructor * */ Hand(const Hand& orig); /** * Overloaded assignment operator * */ Hand& operator=(const Hand& orig); /** * This function should insert a new card into a proper place in the * hand based on the suit of the card: (c.suit) */ void insertCard(const Card& c); /** * If the hand contains any cards of "suit", an arbitrary choice * from that suit should be made, with the card removed from the * hand and returned to the caller. If no cards of the specified * suit are in the hand, then an arbitrary card from some other * suit should be removed from the hand and returned. * * Exceptions: if the hand is completely empty, * throws an EmptyHandException. */ Card playDown(Card::Suit suit); /** * Destructor * */ ~Hand(); private: /* * FEEL FREE TO ADD WHATEVER YOU WISH */ /*================================================ * EXTRA CREDIT follows *================================================*/ public: /** * Define a class which serves as an iterator of Cards. * * */ class Iterator { public: /* * are there more cards left in iteration? */ bool hasNext(); /* * Returns the next available card in the iteration */ Card next(); private: /* * FEEL FREE TO ADD WHATEVER YOU WISH */ }; /** * This routine should create an Iterator, where the iteration * allows one to iterate through all of the Card's in the hand. */ Iterator allCards(); /** * This routine should create an Iterator, where the iteration * allows one to iterate through all of the Card's in the given suit. */ Iterator allOfSuit(Card::Suit suit); }; #endif