-
Notifications
You must be signed in to change notification settings - Fork 0
/
Game.h
72 lines (56 loc) · 1.59 KB
/
Game.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/*
* File: Game.h
* Author: srumeu
*
* Created on 30 mars 2011, 13:00
*/
#ifndef GAME_H
#define GAME_H
#include "Console.h"
#include "main.h"
using namespace std;
class Game {
private:
bool _firstPlayerFoul;
bool _secondPlayerFoul;
unsigned char _p1Start;
unsigned char _p2Start;
unsigned char _creditKey;
unsigned char _p1Switch;
unsigned char _p2Switch;
unsigned char _quitKey;
int _nbGamesPlayed;
int _highScore;
int _averageScore;
int _amaizingScore;
int _nbGamesFouled;
short _lastScoreP1;
short _lastScoreP2;
Console *_con;
void AttractMode(short cycle);
void ErrorReadingConfigFile();
unsigned char GetConfigFileChar(ifstream &configFile);
int GetConfigFileInt(ifstream &configFile);
int GetRandomTimeToWait();
string GetRunNumber(int currentRunNumber, int totalRunNumber);
void KeyConfig();
void OnePlayerGame();
void ReactionTimeDuo(long long ¤tTimeP1, long long ¤tTimeP2);
long long ReactionTimeSolo();
void ReadConfigFile();
unsigned char RedefineKey(string marquee);
void TimeConsumingSleep(long long timeToWait);
short Score(long long realScore);
void ShowConfig();
void ShowKeys(string marquee, unsigned char button1, unsigned char button2);
long long TotalMilliseconds(const timeval * const start, const timeval * const end);
void TwoPlayerGame();
void UpdateScores(int score, bool foul);
void WriteConfigFile();
public:
Game();
virtual ~Game();
void FreeGameLoop();
void NonFreeGameLoop();
};
#endif /* GAME_H */