summaryrefslogtreecommitdiffstats
path: root/api/logic/DefaultVariable.h
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2018-07-15 14:51:05 +0200
committerPetr Mrázek <peterix@gmail.com>2018-07-15 14:51:05 +0200
commitbbb3b3e6f6e3c0f95873f22e6d0a4aaf350f49d9 (patch)
treee6497e304b7b9368367565fbc7c06efab1124b1c /api/logic/DefaultVariable.h
parent03280cc62e75f8073f8d3d9e9e3952acf21fa77d (diff)
downloadMultiMC-bbb3b3e6f6e3c0f95873f22e6d0a4aaf350f49d9.tar
MultiMC-bbb3b3e6f6e3c0f95873f22e6d0a4aaf350f49d9.tar.gz
MultiMC-bbb3b3e6f6e3c0f95873f22e6d0a4aaf350f49d9.tar.lz
MultiMC-bbb3b3e6f6e3c0f95873f22e6d0a4aaf350f49d9.tar.xz
MultiMC-bbb3b3e6f6e3c0f95873f22e6d0a4aaf350f49d9.zip
NOISSUE tabs -> spaces
Diffstat (limited to 'api/logic/DefaultVariable.h')
-rw-r--r--api/logic/DefaultVariable.h54
1 files changed, 27 insertions, 27 deletions
diff --git a/api/logic/DefaultVariable.h b/api/logic/DefaultVariable.h
index 38d7ecc2..5c069bd3 100644
--- a/api/logic/DefaultVariable.h
+++ b/api/logic/DefaultVariable.h
@@ -4,32 +4,32 @@ template <typename T>
class DefaultVariable
{
public:
- DefaultVariable(const T & value)
- {
- defaultValue = value;
- }
- DefaultVariable<T> & operator =(const T & value)
- {
- currentValue = value;
- is_default = currentValue == defaultValue;
- is_explicit = true;
- return *this;
- }
- operator const T &() const
- {
- return is_default ? defaultValue : currentValue;
- }
- bool isDefault() const
- {
- return is_default;
- }
- bool isExplicit() const
- {
- return is_explicit;
- }
+ DefaultVariable(const T & value)
+ {
+ defaultValue = value;
+ }
+ DefaultVariable<T> & operator =(const T & value)
+ {
+ currentValue = value;
+ is_default = currentValue == defaultValue;
+ is_explicit = true;
+ return *this;
+ }
+ operator const T &() const
+ {
+ return is_default ? defaultValue : currentValue;
+ }
+ bool isDefault() const
+ {
+ return is_default;
+ }
+ bool isExplicit() const
+ {
+ return is_explicit;
+ }
private:
- T currentValue;
- T defaultValue;
- bool is_default = true;
- bool is_explicit = false;
+ T currentValue;
+ T defaultValue;
+ bool is_default = true;
+ bool is_explicit = false;
};