M_shop.h 681 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #pragma once
  2. #include <boost/unordered_map.hpp>
  3. #include <vector>
  4. struct M_shopData
  5. {
  6. //ID
  7. int mID;
  8. //类型
  9. int mshop_type;
  10. //购买消耗
  11. std::vector<int> mcost_Item;
  12. //购买获得
  13. std::vector<int> mreward;
  14. //图标
  15. std::string micon;
  16. //排序
  17. int msort;
  18. //开启条件(VIP等级)
  19. int mcondition;
  20. //超值角标
  21. std::string mvalue;
  22. };
  23. class M_shop
  24. {
  25. public:
  26. private:
  27. static std::auto_ptr<M_shop> msSingleton;
  28. public:
  29. int GetCount();
  30. const M_shopData* GetData(int ID);
  31. boost::unordered_map<int, M_shopData>& GetMapData();
  32. void Reload();
  33. void Load(const std::string& path);
  34. void Load();
  35. static M_shop* GetSingleton();
  36. private:
  37. boost::unordered_map<int, M_shopData> mMapData;
  38. };