-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathothergameinit.h
77 lines (66 loc) · 1.62 KB
/
othergameinit.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
72
73
74
75
76
77
#ifndef OTHERGAMEINIT_H
#define OTHERGAMEINIT_H
// File must include
#include "abstractrule.h"
// Forward declaration
class AbstractPixmapWidget;
class AbstractRule;
class Ball;
/**
* @brief A class to record the infomation of a game.
*/
class OtherGameRecord
{
public:
Ball **balls;
int highestScore;
int currentLevel;
int minScore;
int currentScore;
int maxScore;
int flame;
int star;
};
/**
* @brief A class to init other games.
*
* In fact, there are some functions to connect the game with the file.
*/
class OtherGameInit
{
public:
/**
* @brief Init a game with a gesture and type of the game.
*/
static AbstractPixmapWidget *initOtherGame(AbstractRule::Gesture gesture,
int type);
/**
* @brief Get the highest score of the game with index given.
*/
static int getHighest(int index);
/**
* @brief Set the highest score of the game with index given.
*/
static void setHighest(int index, int score);
/**
* @brief Test the highest score of the game with index given, may use
* setHighest.
*/
static void testHighest(int index, int score);
/**
* @brief Get the record of a game with index given.
*/
static OtherGameRecord *loadOtherGame(int index);
/**
* @brief Save the record of a game with index given and the count of the
* balls.
*/
static void saveOtherGame(OtherGameRecord *record,
int index,
int ballCount);
/**
* @brief Clear the record of a game with index given.
*/
static void clearGame(int index);
};
#endif // OTHERGAMEINIT_H