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 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
|
/*
************************************
* @Author: Shah Nami
* @Created: 11 december 2012
* @Title: O9O1.h
************************************
*/
#include <iostream>
#include <cstdlib>
#include <stdlib.h>
#include <vector>
#include <string>
enum kaart {twee=2, drie, vier, vijf, zes, zeven, acht, negen, tien, boer, dame, koning, aas};
enum soort {hart, ruit, klaver, schoppen};
class Card {
private:
kaart nummer;
soort type;
public:
Card();
Card(kaart, soort);
void print();
void set(kaart, soort);
kaart getCard();
soort getSuit();
friend std::ostream& operator<<(std::ostream&, const Card&);
};
class hearts: public Card {
public:
hearts(kaart nummer): Card(nummer, hart){};
friend std::ostream& operator<<(std::ostream&, const hearts&);
};
class diamonds: public Card {
public:
diamonds(kaart nummer): Card(nummer, ruit){};
friend std::ostream& operator<<(std::ostream&, const diamonds&);
};
class clubs: public Card {
public:
clubs(kaart nummer): Card(nummer, klaver){};
friend std::ostream& operator<<(std::ostream&, const clubs&);
};
class spades: public Card {
public:
spades(kaart nummer): Card(nummer, schoppen){};
friend std::ostream& operator<<(std::ostream&, const spades&);
};
class Deck {
private:
Card cards[52];
public:
Deck();
Card get_card(int);
void shuffle();
friend std::ostream& operator<<(std::ostream&, const Deck&);
};
class Hand {
private:
std::string pname;
std::vector<Card> vcards;
public:
Hand();
Hand(std::string);
void printh();
void addCard(Card);
std::string getPlayer();
int count_cards();
friend std::ostream& operator<<(std::ostream&, const Hand&);
};
|