1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
|
#ifndef PLAYING_CARD_HPP
#define PLAYING_CARD_HPP
#include <iostream>
class PlayingCard {
private:
int _face_value;
int _suit;
public:
enum Face_value {
Ace,
Two,
Three,
Four,
Five,
Six,
Seven,
Eight,
Nine,
Ten,
Jack,
Queen,
King
};
enum Suit {
Clubs,
Diamonds,
Hearts,
Spades
};
PlayingCard( Suit suit, Face_value face_value ) : _face_value(face_value), _suit(suit)
{
}
inline int getFaceValue() const {return _face_value;}
inline int getSuit() const {return _suit;}
bool operator< (const PlayingCard& rhs); //function prototype
bool operator> (const PlayingCard& rhs); //function prototype
bool operator== (const PlayingCard& rhs); //function prototype
bool operator!= (const PlayingCard& rhs); //function prototype
friend std::ostream& operator<<(std::ostream &output, const PlayingCard &pc);
};
#endif
|