M_Global_Config.h 692 B

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