-
Notifications
You must be signed in to change notification settings - Fork 0
/
gamemodel.h
64 lines (51 loc) · 1.62 KB
/
gamemodel.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
/// This class handles model side of gameplay.
/// /// Written By: name'); DROP TABLE teams;-- ?
#ifndef GAMEMODEL_H
#define GAMEMODEL_H
#include <QObject>
#include <QFile>
#include <QTextStream>
#include <QStringList>
#include <cmath>
#include <string>
#include <map>
#include "country.h"
#include <cstdlib>
#include <cctype>
using std::string;
class GameModel : public QObject
{
Q_OBJECT
public:
explicit GameModel(QObject *parent = nullptr);
private:
const int allowedGuesses = 5;
//These three below should be selected on startup of game, they are compared to for checking the users guess! not implemented fully:
Country country;
float xCoordCountry;
float yCoordCountry;
int guessNumber;
int roundNumber;
string guessedCountry;
std::vector<Country> countries;
bool won;
std::vector<string> countriesNames;
static string getArrowDirection(double xDirection, double yDirection);
public slots:
void newGuessSlot(std::string guess);
void newGameStartedSlot(int difficulty);
void playNextCountry();
void getSuggestionsForUserSlot(string currentText);
void resetRound();
signals:
void sendUIGuessInfo(std::string guess, int guessNum, double distance, std::vector<QString> hints, std::string arrowDir);
void newCountryPicked(QString filepath, QString fact1);
void sendWin(QString country);
void sendLoss(QString country);
void invalidGuess();
void countryFinished(int finishPosition);
void newSuggestions(std::vector<string> suggs);
void backToMain();
void sendFlagAnimation(QString flagfilepath, int event);
};
#endif // GAMEMODEL_H