Hey guys, I'm writing a program with two classes, one that contains a card's rank and suit and the other contains pile of these cards. I'm having trouble when it comes to adding a pile to another pile...here's what I have so far:
class Card //Card class declaration
{
private:
int rank; //invoking rank
char suit; //invoking suit
public:
void setCard(int r,char s); //determines card suit/rank
int getRank(); //gets card rank
char getSuit(); //gets card suit
bool equals(const Card& c); //compares if cards are equal
int compareTo(const Card& c); //compares card ranks
string toString(); //makes a string of suit and rank
Card(); //defaul constructor
Card(int r, char s); //overloaded constructor
Card(const Card& old); //copy constructor
};
class Pile
{
private:
int count; //number of cards in pile
int size; //max cards allowed in pile
Card* pile; //dynamic array
public:
Pile(); //default constructor
Pile(const Pile& old); //copy constructor
Pile(int newSize); //overloaded constructor
~Pile(); //deconstructor
Card dealCard(); //spits out a new card
bool addCard(const Card& c); //adds card to pile
bool addPile(const Pile& p); //combines piles of cards
//void getCard (int location); //gets cards' rank/suit
int getCount; //displays count
void shuffle(); //shuffles pile of cards
string toString(); //displays pile in orderly fashion
};