M_Global_Config.h 720 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #pragma once
  2. #include <map>
  3. struct M_Global_ConfigData
  4. {
  5. //Key
  6. std::string mKey;
  7. //备注
  8. std::string mDesc;
  9. //数值
  10. int mIntValue;
  11. //数值列表
  12. std::vector<int> mIntListValue;
  13. //字符串
  14. std::string mStrValue;
  15. //字符串列表
  16. std::vector<std::string> mStrListValue;
  17. //布尔值参数
  18. bool mBoolValue;
  19. };
  20. class M_Global_Config
  21. {
  22. public:
  23. private:
  24. static std::auto_ptr<M_Global_Config> msSingleton;
  25. public:
  26. int GetCount();
  27. const M_Global_ConfigData* GetData(std::string Key);
  28. const std::map<std::string, M_Global_ConfigData>& GetMapData();
  29. void Load();
  30. void LoadLua();
  31. void Reload();
  32. static M_Global_Config* GetSingleton();
  33. static void Release();
  34. private:
  35. std::map<std::string, M_Global_ConfigData> mMapData;
  36. };