-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsavegame.h
More file actions
38 lines (29 loc) · 737 Bytes
/
savegame.h
File metadata and controls
38 lines (29 loc) · 737 Bytes
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
#ifndef SAVEGAME_H
#define SAVEGAME_H
#include <QJsonObject>
#include <QString>
#include <ctime>
class Savegame
{
public:
Savegame();
Savegame(const QString &name, int score);
QString name() const;
void setName(const QString &name);
int score() const;
int lines() const;
float spm() const;
void setScore(int score);
void setLines(int lines);
void setSpm(int spm);
void read(const QJsonObject &json);
void write(QJsonObject &json) const;
bool storeGame(QJsonObject &json) const;
QByteArray datastream(QJsonObject &json) const;
private:
QString my_name;
int my_score;
int my_lines;
float my_spm;
};
#endif // SAVEGAME_H