forked from AA789-ai/WarzoneGame-COMP345
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCardsDriver.cpp
More file actions
74 lines (52 loc) · 1.78 KB
/
CardsDriver.cpp
File metadata and controls
74 lines (52 loc) · 1.78 KB
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
#include "CardsDriver.h"
#include "Cards.h"
#include "Orders.h"
void testCards() {
Deck* deck1 = new Deck();
Hand* hand1 = new Hand();
OrdersList* ordersList1 = new OrdersList();
int deckSize = deck1->cards.size();
std::cout << "Deck size: " << deckSize << std::endl;
int handSize1 = hand1->cards.size();
std::cout << "Hand size: " << handSize1 << std::endl;
int orderListSize = ordersList1->orders.size();
std::cout << "OrdersList size: " << orderListSize << std::endl;
for (int i = 0; i < 7; i++) {
deck1->draw(*hand1);
}
deckSize = deck1->cards.size();
std::cout << "Deck size: " << deckSize << std::endl;
handSize1 = hand1->cards.size();
std::cout << "Hand size: " << handSize1 << std::endl;
orderListSize = ordersList1->orders.size();
std::cout << "OrdersList size: " << orderListSize << std::endl;
for (int i = 0; i < 7; i++) {
hand1->cards[0]->play(*hand1, 0, *ordersList1);
//hand1->cards[0]->play(*hand1, 0);
}
deckSize = deck1->cards.size();
std::cout << "Deck size: " << deckSize << std::endl;
handSize1 = hand1->cards.size();
std::cout << "Hand size: " << handSize1 << std::endl;
orderListSize = ordersList1->orders.size();
std::cout << "OrdersList size: " << orderListSize << std::endl;
for (Card* card : deck1->cards) {
delete card;
}
deck1->cards.clear();
for (Card* card : hand1->cards) {
delete card;
}
hand1->cards.clear();
for (Order* order : ordersList1->orders) {
delete order;
}
ordersList1->orders.clear();
delete deck1;
delete hand1;
delete ordersList1;
}
/*int main()
{
testCards();
}*/