M_RobotsCFG.h 746 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #pragma once
  2. #include <boost/unordered_map.hpp>
  3. #include <vector>
  4. struct M_RobotsCFGData
  5. {
  6. //编号
  7. int mID;
  8. //排行类型
  9. int mRankingTyep;
  10. //上榜时间
  11. std::vector<int> mTime;
  12. //机器人数量
  13. std::vector<int> mNumberOfRobots;
  14. //最小积分
  15. int mMin;
  16. //最大积分
  17. int mMax;
  18. //最小生成历史条数
  19. int mCreateHisCountMin;
  20. //最大生成历史条数
  21. int mCreateHisCountMax;
  22. };
  23. class M_RobotsCFG
  24. {
  25. public:
  26. private:
  27. static std::auto_ptr<M_RobotsCFG> msSingleton;
  28. public:
  29. int GetCount();
  30. const M_RobotsCFGData* GetData(int ID);
  31. boost::unordered_map<int, M_RobotsCFGData>& GetMapData();
  32. void Reload();
  33. void Load(const std::string& path);
  34. void Load();
  35. static M_RobotsCFG* GetSingleton();
  36. private:
  37. boost::unordered_map<int, M_RobotsCFGData> mMapData;
  38. };