Fish_SquamaExchangeCFG.h 922 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #pragma once
  2. #include <boost/unordered_map.hpp>
  3. #include <vector>
  4. struct Fish_SquamaExchangeCFGData
  5. {
  6. //ID
  7. int mID;
  8. //价格
  9. int mPrice;
  10. //折扣礼包, 对应M_RechangeCFG中的id
  11. std::vector<int> mDiscountGift;
  12. //折扣价格
  13. std::vector<int> mSalePrice;
  14. //最终折扣价格
  15. int mFinalPrice;
  16. //奖励道具,填M_ItemCFG中的道具ID
  17. std::vector<int> mRewardList;
  18. //道具数量
  19. std::vector<int> mRewardCount;
  20. //获取奖励概率
  21. std::vector<int> mRate;
  22. //黄金图标
  23. std::string mGoldIcon;
  24. };
  25. class Fish_SquamaExchangeCFG
  26. {
  27. public:
  28. private:
  29. static std::auto_ptr<Fish_SquamaExchangeCFG> msSingleton;
  30. public:
  31. int GetCount();
  32. const Fish_SquamaExchangeCFGData* GetData(int ID);
  33. boost::unordered_map<int, Fish_SquamaExchangeCFGData>& GetMapData();
  34. void Reload();
  35. void Load(const std::string& path);
  36. void Load();
  37. static Fish_SquamaExchangeCFG* GetSingleton();
  38. private:
  39. boost::unordered_map<int, Fish_SquamaExchangeCFGData> mMapData;
  40. };