-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgame.h
55 lines (44 loc) · 1.21 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
#ifndef GAME_H
#define GAME_H
#include "player.h"
#include "music.h"
#include "film.h"
#include <QString>
#include "QtSql/QSqlDatabase"
#include "QSqlQuery"
#include "QApplication"
enum levelType {easy = 1, middle, difficult};
class Game
{
private:
Player player;
QuestCards *questCards[2];
QSqlDatabase db;
int currentScore;
levelType level;
public:
Game();
~Game();
Player getPlayer() const;
void setPlayer(const Player &value);
void setPlayerScore(int value, QString type);
bool login(QString name, QString pass);
void logout();
bool isLogin();
bool signup(QString name, QString pass);
QSqlQuery getUserFromDB(QString username);
QSqlQuery getStats();
void connectDB();
bool playGame(QString type);
QString getAnswer(QString type, int id);
QString getRightAnswerId(QString type);
QString getRightAnswerNameStr(QString type);
QString getRightAnswerCount(QString type);
bool checkAnswerId(QString type, int id);
void eraseContent(QString type);
int getCurrentScore() const;
void setCurrentScore(int value);
int calculateScore(int sec, QString type);
void changeScoreInDB(QString type, int score);
};
#endif // GAME_H