-
Notifications
You must be signed in to change notification settings - Fork 0
/
Baseball.h
50 lines (47 loc) · 978 Bytes
/
Baseball.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
50
#ifndef BASEBALL_H
#define BASEBALL_H
#include <string>
using namespace std;
struct batter
{
int number;
double hits;
double avg;
int slg;
int obp;
int rbi;
int runs;
int b1;
int b2;
int b3;
int b4;
int bt;
double atbats;
bool ondeck = false;
batter *previous;
batter *next;
};
class Baseball
{
public:
Baseball();
~Baseball();
int mainMenu();
void scorecard(bool sim);
batter *halfInning(batter *current);
void buildLineups(bool sim);
void teamA(bool sim);
void teamB(bool sim);
void inningAnnouncement(int inning, bool top);
int keepScore(int score,batter*current, bool top, bool sim);
void calcAvg(batter *player, double hit);
void calcOBP();
void calcSLG();
protected:
private:
batter *headA;
batter *headB;
batter *up;
int bases[15];
};
#endif // BASEBALL_H