M_ActivExchange.h 637 B

123456789101112131415161718192021222324252627282930313233
  1. #pragma once
  2. #include <map>
  3. struct M_ActivExchangeData
  4. {
  5. //ID
  6. int mID;
  7. //兑换所需物品
  8. std::vector<int> mExchangeItems;
  9. //所需物品数量
  10. std::vector<int> mQuantityRequired;
  11. //兑换获得物品
  12. int mGetItems;
  13. //获得物品数量
  14. int mGetQuantity;
  15. };
  16. class M_ActivExchange
  17. {
  18. public:
  19. private:
  20. static std::auto_ptr<M_ActivExchange> msSingleton;
  21. public:
  22. int GetCount();
  23. const M_ActivExchangeData* GetData(int ID);
  24. const std::map<int, M_ActivExchangeData>& GetMapData();
  25. void Load();
  26. void LoadLua();
  27. void Reload();
  28. static M_ActivExchange* GetSingleton();
  29. static void Release();
  30. private:
  31. std::map<int, M_ActivExchangeData> mMapData;
  32. };