-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHand.h
48 lines (41 loc) · 987 Bytes
/
Hand.h
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
#include "stdafx.h"
#include <string>
#include <sstream>
#include <fstream>
#include <iostream>
#include <vector>
#include "Card.h"
using namespace std;
#ifndef HAND_H
#define HAND_H
struct Hand
{
public:
// Constructors and destructor
Hand();
Hand(const Card * cards, int size);
Hand(const Hand & hand);
~Hand();
// Class methods
bool operator<(const Hand &otherHand) const;
bool operator>(const Hand &otherHand) const;
Hand & operator=(const Hand otherHand);
bool operator==(const Hand &otherHand) const;
const Card & operator[] (size_t position);
void remove_card (size_t position);
int size() const;
bool copy(const Hand & hand);
void print() const;
string toString() const;
//getters and setters
vector<Card> get_cards() const;
void set_cards(vector<Card> cards);
Card get_card(int index) const;
void insert(Card card);
private:
vector<Card> _cards;
void sortCards();
};
//non-member stuff
ostream & operator<<(ostream & out, const Hand & hand);
#endif