-
Notifications
You must be signed in to change notification settings - Fork 2
/
groundglobal.h
108 lines (93 loc) · 2.95 KB
/
groundglobal.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
/*
* Copyright (C) Kreogist Dev Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef GROUNDGLOBAL_H
#define GROUNDGLOBAL_H
#include <QObject>
#include <QColor>
/*!
* \brief The GroundGlobal class is a singleton class for ground. It contains
* several global settings of the ground, like the color configure.
*/
class GroundGlobal : public QObject
{
Q_OBJECT
public:
/*!
* \brief Get the instance of the ground global.
* \return The singleton instance.
*/
static GroundGlobal *instance();
/*!
* \brief Get the color of the border.
* \return The QColor of the border.
*/
QColor borderColor();
/*!
* \brief Get the color of the barracks border.
* \return The QColor of the barracks border.
*/
QColor barracksColor();
/*!
* \brief Get the color of the reference line.
* \return The QColor of the reference line.
*/
QColor referenceLineColor();
/*!
* \brief Get the color of the ground base.
* \return The QColor of the ground base.
*/
QColor baseColor() const;
/*!
* \brief Get the color of the ground.
* \return The QColor of the ground.
*/
QColor groundColor() const;
signals:
/*!
* \brief When this signal is emitted, it will ask the container to change
* the base color.
*/
void baseColorChanged(const QColor &color);
public slots:
/*!
* \brief Sets the color of the border.
* \param borderColor The prefer color of the border.
*/
void setBorderColor(const QColor &borderColor);
/*!
* \brief Sets the color of the barracks.
* \param barracksColor The prefer color of the barracks.
*/
void setBarracksColor(const QColor &barracksColor);
/*!
* \brief Sets the color of the ground base.
* \param baseColor The prefer color of the ground.
*/
void setBaseColor(const QColor &baseColor);
/*!
* \brief Sets the color of the ground.
* \param groundColor The prefer color of the ground.
*/
void setGroundColor(const QColor &groundColor);
private:
static GroundGlobal *m_instance;
explicit GroundGlobal(QObject *parent = 0);
QColor m_borderColor, m_barracksColor, m_referenceLineColor, m_baseColor,
m_groundColor;
};
#endif // GROUNDGLOBAL_H