I am going to write an enumerated type that identifies the suit of the jail cell. However, it should be from another class - Card.
I tried to code it like that
Code:
enum card::suit; //an enumerated type (located in the Card ADT) that identifies the suit of the jail cell
I think it is not going to work, can anyone gives me some suggest?
Here is the code from card.h
Code:
#include <iostream>
using namespace std;
class Card
{
public:
enum Rank
{
ACE,
TWO,
THREE,
FOUR,
FIVE,
SIX,
SEVEN,
EIGHT,
NINE,
TEN,
JACK,
QUEEN,
KING
};
enum Suit
{
SPADES,
HEARTS,
CLUBS,
DIAMONDS
};
Card(); // Default constructor will initialize to Ace of Spades
Card( Rank newRank, Suit newSuit );
Rank getRank() const {return rank;}
Suit getSuit() const {return suit;}
void setRank( Rank newRank );
void setSuit( Suit newSuit );
private:
Rank rank;
Suit suit;
};
ostream& operator<<( ostream& os, const Card& card );
appericate it.
I tried to code it like that
Code:
enum card::suit; //an enumerated type (located in the Card ADT) that identifies the suit of the jail cell
I think it is not going to work, can anyone gives me some suggest?
Here is the code from card.h
Code:
#include <iostream>
using namespace std;
class Card
{
public:
enum Rank
{
ACE,
TWO,
THREE,
FOUR,
FIVE,
SIX,
SEVEN,
EIGHT,
NINE,
TEN,
JACK,
QUEEN,
KING
};
enum Suit
{
SPADES,
HEARTS,
CLUBS,
DIAMONDS
};
Card(); // Default constructor will initialize to Ace of Spades
Card( Rank newRank, Suit newSuit );
Rank getRank() const {return rank;}
Suit getSuit() const {return suit;}
void setRank( Rank newRank );
void setSuit( Suit newSuit );
private:
Rank rank;
Suit suit;
};
ostream& operator<<( ostream& os, const Card& card );
appericate it.