-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBidingFacilityMain.cpp
More file actions
46 lines (41 loc) · 1.42 KB
/
BidingFacilityMain.cpp
File metadata and controls
46 lines (41 loc) · 1.42 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
//
// Created by Ming on 2/15/2021.
//
#include "BidingFacilityMain.h"
#include "BidingFacility.h"
#include <vector>
using namespace std;
int biding::main () {
cout << "\nTesting Biding Facility:" << endl;
vector<Player*> players;
vector<string> firstNames{"John", "Danny", "Alice"};
vector<string> lastNames{"Smith", "Brown", "Miller"};
const vector<string> COLORS{"purple", "white", "green"};
players.reserve(3);
vector<Territory *> territories;
for (int i = 0; i < 3; ++i) {
players.emplace_back(new Player(i + 1, firstNames[i], lastNames[i], COLORS[i], 0, 14, territories));
}
players[0]->setBidding(2);
players[1]->setBidding(1);
players[2]->setBidding(1);
cout << "The winner is player " << BidingFacility::bid(players) << endl;
players[0]->setBidding(1);
players[1]->setBidding(0);
players[2]->setBidding(1);
cout << "The winner is player " << BidingFacility::bid(players) << endl;
players[0]->setBidding(0);
players[1]->setBidding(0);
players[2]->setBidding(0);
cout << "The winner is player " << BidingFacility::bid(players) << endl;
players[0]->setBidding(0);
players[1]->setBidding(0);
players[2]->setBidding(0);
players[2]->setLastName(lastNames[1]);
cout << "The winner is player " << BidingFacility::bid(players) << endl;
for (auto & player : players) {
delete player;
player = nullptr;
}
return 0;
}