-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTester.cpp
More file actions
72 lines (63 loc) · 1.57 KB
/
Copy pathTester.cpp
File metadata and controls
72 lines (63 loc) · 1.57 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
/*#pragma once
#include "Player.h"
#include <iostream>
#include "Team.h"
#include "Match.h"
using namespace std;
//Player player("Rohit Sharma", "Bat", 4898, 130.82, 431, 194, 0, 0);
//Player player("Lasith Malinga", "Ball", 88, 88.88, 6, 5, 2827, 170);
void testPlayer(Player player) {
cout << player.name << "\t";
cout << player.role << "\t";
cout << player.pFours << "\t";
cout << player.pOnes << "\t";
cout << player.pSixes << "\t";
cout << player.pZero << "\t";
cout << player.pWicket << "\t";
cout << player.canBall() << "\n";
}
void testTeam(Team team) {
while (!team.bowling.empty()) {
testPlayer(team.bowling.front());
team.getBowler();
}
}
void testTakesWicket(Player player) {
for (int i = 0; i < 100; i++) {
cout << player.takesWicket() << "\t";
}
cout << "\n";
}
void testBats(Player player) {
for (int i = 0; i < 100; i++) {
cout << player.bats() << "\t";
}
cout << "\n";
}
void testMatch() {
Team mi("MI");
Team csk("CSK");
Team* mip = &mi;
Team* cskp = &csk;
Match match1(mip, cskp);
match1.play();
cout << match1.team1->runsScored << "\n";
cout << match1.team2->runsScored << "\n";
cout << match1.team1->wicketsLost << "\n";
cout << match1.team2->wicketsLost << "\n";
Match match2(cskp, mip);
match2.play();
cout << match2.team1->runsScored << "\n";
cout << match2.team2->runsScored << "\n";
cout << match2.team1->wicketsLost << "\n";
cout << match2.team2->wicketsLost << "\n";
}
int main() {
srand((unsigned)time(0));
//testTeam(Team("MI"));
//testPlayer(player);
//testTakesWicket(player);
//testBats(player);
testMatch();
return 0;
}*/