M_NewSevenDayCFG.h 720 B

123456789101112131415161718192021222324252627282930313233
  1. #pragma once
  2. #include <boost/unordered_map.hpp>
  3. #include <vector>
  4. struct M_NewSevenDayCFGData
  5. {
  6. //第几天
  7. int mDay;
  8. //奖励物品ID
  9. std::vector<int> mAwardItemIDs;
  10. //奖励物品数量
  11. std::vector<int> mAwardItemCounts;
  12. //累计签到奖励ID,0-无效
  13. int mAccumAwardId;
  14. //累计签到奖励数量
  15. int mAccumAwardCount;
  16. };
  17. class M_NewSevenDayCFG
  18. {
  19. public:
  20. private:
  21. static std::auto_ptr<M_NewSevenDayCFG> msSingleton;
  22. public:
  23. int GetCount();
  24. const M_NewSevenDayCFGData* GetData(int Day);
  25. boost::unordered_map<int, M_NewSevenDayCFGData>& GetMapData();
  26. void Reload();
  27. void Load(const std::string& path);
  28. void Load();
  29. static M_NewSevenDayCFG* GetSingleton();
  30. private:
  31. boost::unordered_map<int, M_NewSevenDayCFGData> mMapData;
  32. };