-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgamedata.h
51 lines (37 loc) · 1.26 KB
/
gamedata.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 GAMEDATA_H
#define GAMEDATA_H
#include <QGeoPositionInfo>
#include <QObject>
class GameData : public QObject
{
Q_OBJECT
public:
explicit GameData():QObject(){}
~GameData(){}
uint accountId() const{ return _accountId;}
QString accountName() const{ return _accountName;}
void setAccountData( uint id, QString name){
_accountId = id;
_accountName = name;
}
uint campaignId() const{ return _campaignId;}
QString campaignName() const{ return _campaignName;}
void setcampaignData( uint id, QString name){
_campaignId = id;
_campaignName = name;
}
qreal lastDirection() const { return _lastDirection;}
void setLastDirection( qreal dir) { _lastDirection = dir;}
QGeoPositionInfo lastPosition() const { return _lastPosition;}
void setLastPosition( QGeoPositionInfo pos) { _lastPosition = pos;}
private:
//Owned by AccountManager
uint _accountId = 0;
QString _accountName = "";
//Owned by CampaignManager
uint _campaignId = 0; //ID of the current campaign - 0 if no campaing is selected with startGame()
QString _campaignName = "";
QGeoPositionInfo _lastPosition = QGeoPositionInfo();
qreal _lastDirection = 0.;
};
#endif // GAMEDATA_H