M_GiftRewardCFG.h 883 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #pragma once
  2. #include <boost/unordered_map.hpp>
  3. #include <vector>
  4. struct M_GiftRewardCFGData
  5. {
  6. //奖励类型
  7. int mRewardType;
  8. //开始时间
  9. std::string mStartTime;
  10. //结束时间
  11. std::string mEndTime;
  12. //道具ID
  13. std::vector<int> mItemId;
  14. //数量
  15. std::vector<int> mItemCount;
  16. //首次购买
  17. std::vector<int> mItemId2;
  18. //立即赠送
  19. std::vector<int> mItemId3;
  20. //现价
  21. int mPrice;
  22. //总价
  23. std::vector<int> mTotalPrice;
  24. //需要vip等级
  25. int mVipLevel;
  26. //礼包id
  27. int mGiftId;
  28. };
  29. class M_GiftRewardCFG
  30. {
  31. public:
  32. private:
  33. static std::auto_ptr<M_GiftRewardCFG> msSingleton;
  34. public:
  35. int GetCount();
  36. const M_GiftRewardCFGData* GetData(int RewardType);
  37. boost::unordered_map<int, M_GiftRewardCFGData>& GetMapData();
  38. void Reload();
  39. void Load(const std::string& path);
  40. void Load();
  41. static M_GiftRewardCFG* GetSingleton();
  42. private:
  43. boost::unordered_map<int, M_GiftRewardCFGData> mMapData;
  44. };