Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/gui/CGUISetting.h
Show First 20 Lines • Show All 49 Lines • ▼ Show 20 Lines | |||||
}; | }; | ||||
template<typename T> | template<typename T> | ||||
class CGUISetting : public IGUISetting | class CGUISetting : public IGUISetting | ||||
{ | { | ||||
public: | public: | ||||
NONCOPYABLE(CGUISetting); | NONCOPYABLE(CGUISetting); | ||||
CGUISetting(IGUIObject& pObject, const CStr& Name); | CGUISetting(IGUIObject& pObject, const CStr& Name, T& Value); | ||||
/** | /** | ||||
* Parses the given string and assigns to the setting value. Used for parsing XML attributes. | * Parses the given string and assigns to the setting value. Used for parsing XML attributes. | ||||
*/ | */ | ||||
bool FromString(const CStrW& Value, const bool SendMessage) override; | bool FromString(const CStrW& Value, const bool SendMessage) override; | ||||
/** | /** | ||||
* Parses the given JS::Value using ScriptInterface::FromJSVal and assigns it to the setting data. | * Parses the given JS::Value using ScriptInterface::FromJSVal and assigns it to the setting data. | ||||
Show All 16 Lines | public: | ||||
IGUIObject& m_pObject; | IGUIObject& m_pObject; | ||||
/** | /** | ||||
* Property name identifying the setting. | * Property name identifying the setting. | ||||
*/ | */ | ||||
const CStr m_Name; | const CStr m_Name; | ||||
/** | /** | ||||
* Holds the value of the setting. | * Holds a reference to the value of the setting. | ||||
* The setting value is stored in the member class to optimize for draw calls of that class. | |||||
*/ | */ | ||||
T m_pSetting; | T& m_pSetting; | ||||
}; | }; | ||||
#endif // INCLUDED_CGUISETTINGS | #endif // INCLUDED_CGUISETTINGS |
Wildfire Games · Phabricator