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. };