-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcards.h
49 lines (42 loc) · 1.18 KB
/
cards.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
49
#pragma once
#include <stack>
#include <vector>
#include <random>
#include <limits>
#include <algorithm>
#include <iostream>
enum CardType {INFANTRY = 1, CAVALRY = 2, ARTILLERY = 3, NULLCARD = -1};
static int totalExchanges = 0;
class Deck{
private:
//could abstract a util method for random ints
//to be used in dice and card classes
std::stack<CardType>* cards;
CardType genCard();
public:
Deck();
~Deck();
//It doesn't make sense to tightly couple map and deck classes, keep separate
Deck(int mapSize);
CardType draw();
int size();
};
class Hand{
private:
std::vector<CardType>* cards;
public:
int exchange();
Hand();
~Hand();
bool addToHand(CardType card);
bool removeFromHand(CardType card);
bool removeFromHand(CardType card, int quantity);
std::string cardToString(CardType card);
//test method remove for prod
void showHand(){
std::cout<<"Displaying hand..."<<std::endl;
for(CardType c : (*cards)){
std::cout<<cardToString(c)<<std::endl;
}
}
};