M_Synthesis.h 659 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #pragma once
  2. #include <boost/unordered_map.hpp>
  3. #include <vector>
  4. struct M_SynthesisData
  5. {
  6. //编号
  7. int mId;
  8. //类型
  9. int mType;
  10. //需要道具
  11. int mneedItem;
  12. //需要数量
  13. int mneedCount;
  14. //物品名
  15. std::string mItemName;
  16. //获得道具
  17. int mitemId;
  18. //获得数量
  19. int mitemCount;
  20. };
  21. class M_Synthesis
  22. {
  23. public:
  24. private:
  25. static std::auto_ptr<M_Synthesis> msSingleton;
  26. public:
  27. int GetCount();
  28. const M_SynthesisData* GetData(int Id);
  29. boost::unordered_map<int, M_SynthesisData>& GetMapData();
  30. void Reload();
  31. void Load(const std::string& path);
  32. void Load();
  33. static M_Synthesis* GetSingleton();
  34. private:
  35. boost::unordered_map<int, M_SynthesisData> mMapData;
  36. };