-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGlobalOptions.h
More file actions
54 lines (40 loc) · 955 Bytes
/
GlobalOptions.h
File metadata and controls
54 lines (40 loc) · 955 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#pragma once
#include <Qt>
#include <QString>
#include <tuple>
enum class Player_t;
enum class PlayersPos_t;
using PlayerSettings = std::tuple<Player_t, PlayersPos_t, QString>;
namespace Settings {
template<typename T = PlayerSettings>
inline auto&& type(T &ps)
{
return std::get<Player_t>(ps);
}
template<typename T = PlayerSettings>
inline auto&& pos(T &ps)
{
return std::get<PlayersPos_t>(ps);
}
template<typename T = PlayerSettings>
inline auto&& name(T &ps)
{
return std::get<QString>(ps);
}
};
enum class Language {
ENGLISH,
RUSSIAN
};
class GlobalOptions {
public:
static GlobalOptions& instance();
void initQApplication();
void setPlayers(const QVector<PlayerSettings>&);
const QVector<PlayerSettings>& players() const;
void setLanguage(Language);
Language language() const;
private:
GlobalOptions() = default;
protected:
};