ConfigVar.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #ifndef CONFIG_VAR_H
  2. #define CONFIG_VAR_H
  3. #include <OgreString.h>
  4. class ConfigVarManager;
  5. class ConfigVar
  6. {
  7. friend class ConfigVarManager;
  8. public:
  9. ConfigVar(const Ogre::String& name, const Ogre::String& description, const Ogre::String& default_value);
  10. int GetI() const;
  11. float GetF() const;
  12. bool GetB() const;
  13. Ogre::String GetS() const;
  14. void SetI(int value);
  15. void SetF(float value);
  16. void SetB(bool value);
  17. void SetS(const Ogre::String& value);
  18. const Ogre::String& GetName() const;
  19. const Ogre::String& GetDescription() const;
  20. const Ogre::String& GetDefaultValue() const;
  21. void UpdateVariables();
  22. private:
  23. // forbid copy
  24. ConfigVar(const ConfigVar&) = delete;
  25. ConfigVar&operator=(const ConfigVar&) = delete;
  26. Ogre::String m_Name;
  27. Ogre::String m_Description;
  28. Ogre::String m_DefaultValue;
  29. int m_ValueI;
  30. float m_ValueF;
  31. bool m_ValueB;
  32. Ogre::String m_ValueS;
  33. ConfigVar* m_Previous;
  34. static ConfigVar* m_StaticConfigVarList;
  35. };
  36. #endif // CONFIG_VAR_H