V-Gears 0
Free Final Fantasy VII engine.
ConfigVar.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2022 The V-Gears Team
3 *
4 * This file is part of V-Gears
5 *
6 * V-Gears is free software: you can redistribute it and/or modify it under
7 * terms of the GNU General Public License as published by the Free Software
8 * Foundation, version 3.0 (GPLv3) of the License.
9 *
10 * V-Gears is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15
16#pragma once
17
18#include <OgreString.h>
19
21
26 friend class ConfigVarHandler;
27
28 public:
29
38 const Ogre::String& name, const Ogre::String& description,
39 const Ogre::String& default_value
40 );
41
47 int GetI() const;
48
54 float GetF() const;
55
61 bool GetB() const;
62
68 Ogre::String GetS() const;
69
75 void SetI(int value);
76
82 void SetF(float value);
83
89 void SetB(bool value);
90
96 void SetS(const Ogre::String& value);
97
103 const Ogre::String& GetName() const;
104
110 const Ogre::String& GetDescription() const;
111
117 const Ogre::String& GetDefaultValue() const;
118
122 void UpdateVariables();
123
124 private:
125
129 ConfigVar(const ConfigVar&) = delete;
130
134 ConfigVar&operator=(const ConfigVar&) = delete;
135
140
145
150
155
159 float value_f_;
160
165
170
175
180};
181
Configuration variable hanlder.
Definition: ConfigVarHandler.h:25
A configuration variable.
Definition: ConfigVar.h:25
void SetB(bool value)
Sets the boolean value of the variable.
Definition: ConfigVar.cpp:58
int value_i_
Variable value, integer format.
Definition: ConfigVar.h:154
void SetS(const Ogre::String &value)
Sets the string value of the variable.
Definition: ConfigVar.cpp:63
const Ogre::String & GetDefaultValue() const
Retrieves the variable default value.
Definition: ConfigVar.cpp:72
ConfigVar(const Ogre::String &name, const Ogre::String &description, const Ogre::String &default_value)
Constructor.
Definition: ConfigVar.cpp:22
const Ogre::String & GetDescription() const
Retrieves the variable description.
Definition: ConfigVar.cpp:70
const Ogre::String & GetName() const
Retrieves the variable name.
Definition: ConfigVar.cpp:68
void SetF(float value)
Sets the float value of the variable.
Definition: ConfigVar.cpp:53
Ogre::String description_
The variable description.
Definition: ConfigVar.h:144
Ogre::String GetS() const
Retrieves the value of the variable in string form.
Definition: ConfigVar.cpp:46
float GetF() const
Retrieves the value of the variable in float form.
Definition: ConfigVar.cpp:42
float value_f_
Variable value, float format.
Definition: ConfigVar.h:159
int GetI() const
Retrieves the value of the variable in integer form.
Definition: ConfigVar.cpp:40
ConfigVar(const ConfigVar &)=delete
Forbidden copy constructor.
void UpdateVariables()
Updates the integer and float values from the string value.
Definition: ConfigVar.cpp:74
Ogre::String name_
The variable name.
Definition: ConfigVar.h:139
bool value_b_
Variable value, integer format.
Definition: ConfigVar.h:164
ConfigVar * previous_
Definition: ConfigVar.h:174
void SetI(int value)
Sets the integer value of the variable.
Definition: ConfigVar.cpp:48
ConfigVar & operator=(const ConfigVar &)=delete
Forbidden copy constructor.
static ConfigVar * static_config_var_list_
Definition: ConfigVar.h:179
bool GetB() const
Retrieves the value of the variable in boolean form.
Definition: ConfigVar.cpp:44
Ogre::String value_s_
Variable value, string format.
Definition: ConfigVar.h:169
Ogre::String default_value_
The variable default value.
Definition: ConfigVar.h:149
Ogre::String String
Definition: TypeDefine.h:37