-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHighscore.h
54 lines (44 loc) · 1.25 KB
/
Highscore.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
#ifndef __HIGHSCORE_H_INCLUDED__
#define __HIGHSCORE_H_INCLUDED__
#include <vector>
#include <string>
#include <algorithm>
#include <iostream>
#include "Graphics.h"
#include "Config.h"
//miten on, mahtaako näiden using lauseiden yksitellen määrittäminen vaikuttaa käännöksen lopputulokseen?
using std::vector;
using std::cout;
using std::string;
class CHighscore {
struct Score {
string name;
int score;
};
public:
CHighscore(void);
virtual ~CHighscore(void);
/**
* loadScores
*
* Ladataan pistedata tiedostosta.
*/
void loadScores();
/**
* saveScore
*
* Lisää pistedatan listaan. Sorttaa listan ja tallentaa SCORE_AMOUNT määrän parhaita pisteitä tiedostoon.
*/
void saveScore(string playerName, int playerScore);
//std::sort(scores->begin, scores->end, vertailuehto)
//vertailuehto(x, y) The ordered pair (x,y) Returns true if x precedes y, and false otherwise
inline void setFilename(string filename) { m_strFilename = filename; };
inline string getFilename() { return m_strFilename; };
private:
SGraphics * g;
SConfig * settings;
vector<Score*> scores;
string m_strFilename;
int score_amount;
};
#endif // __HIGHSCORE_H_INCLUDED__