M_GameCFG.h 964 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #pragma once
  2. #include <boost/unordered_map.hpp>
  3. #include <vector>
  4. struct M_GameCFGData
  5. {
  6. //key
  7. int mID;
  8. //游戏名字
  9. std::string mGameName;
  10. //游戏路径
  11. std::string mGamePrefix;
  12. //更新地址
  13. std::string mUpdateUrl;
  14. //是否开放
  15. bool mIsOpen;
  16. //游戏大小
  17. std::string mGameSize;
  18. //zip版本
  19. std::string mZipVersion;
  20. //动画名称
  21. std::string mAnimationName;
  22. //是否显示
  23. bool mIsShow;
  24. //显示序号
  25. int mShowIndex;
  26. //进入金币要求
  27. int mEnterGold;
  28. //进入VIP
  29. int mEnterVIP;
  30. //显示推荐图标
  31. std::string mShowTip;
  32. //游戏图标
  33. std::string mGameIcon;
  34. //游戏名称图片
  35. std::string mGameNameImg;
  36. };
  37. class M_GameCFG
  38. {
  39. public:
  40. private:
  41. static std::auto_ptr<M_GameCFG> msSingleton;
  42. public:
  43. int GetCount();
  44. const M_GameCFGData* GetData(int ID);
  45. boost::unordered_map<int, M_GameCFGData>& GetMapData();
  46. void Reload();
  47. void Load(const std::string& path);
  48. void Load();
  49. static M_GameCFG* GetSingleton();
  50. private:
  51. boost::unordered_map<int, M_GameCFGData> mMapData;
  52. };