M_ActiveReward.h 663 B

1234567891011121314151617181920212223242526272829303132333435
  1. #pragma once
  2. #include <boost/unordered_map.hpp>
  3. #include <vector>
  4. struct M_ActiveRewardData
  5. {
  6. //编号
  7. int mID;
  8. //达成所需活跃度
  9. int mNeedActive;
  10. //没用
  11. std::string mName;
  12. //奖励物品ID
  13. int mItemId;
  14. //奖励物品数量
  15. int mCount;
  16. //图标
  17. std::string mIcon;
  18. };
  19. class M_ActiveReward
  20. {
  21. public:
  22. private:
  23. static std::auto_ptr<M_ActiveReward> msSingleton;
  24. public:
  25. int GetCount();
  26. const M_ActiveRewardData* GetData(int ID);
  27. boost::unordered_map<int, M_ActiveRewardData>& GetMapData();
  28. void Reload();
  29. void Load(const std::string& path);
  30. void Load();
  31. static M_ActiveReward* GetSingleton();
  32. private:
  33. boost::unordered_map<int, M_ActiveRewardData> mMapData;
  34. };