-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGameSettings.h
46 lines (39 loc) · 955 Bytes
/
GameSettings.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
#pragma once
#include <string>
#include <map>
#include <SFML/Graphics.hpp>
#include "Enums.h"
// singleton class for loading game settings
class GameSettings
{
public:
struct Controls_Settings {
std::map<Controls_Key, sf::Keyboard::Key> keybinds;
int sfx = 0;
int music = 0;
};
struct Highscores {
std::map<std::string, int> dropToBeatHS;
std::map<std::string, int> dropToBeatThreshold;
int endless = 0;
int limit = 0;
int sprintTime = INT_MAX; // time in miliseconds, the lower the better
};
static GameSettings* getInstance();
Controls_Settings* getSettings();
Highscores* getHighscores();
void loadFiles();
void saveKeys();
void saveConfig();
void saveHighscores();
int getBeatMapThreshold(std::string songName);
private:
static GameSettings* instance;
Controls_Settings* controlsSettings;
Highscores* highscores;
GameSettings();
~GameSettings();
void initKeys();
void initConfig();
void initHighscores();
};