M_ExchangeCFG.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #pragma once
  2. #include <boost/unordered_map.hpp>
  3. #include <vector>
  4. struct M_ExchangeCFGData
  5. {
  6. //兑换ID
  7. int mChangeId;
  8. //所在功能
  9. int mFunction;
  10. // 兑换顺序
  11. int moder;
  12. //道具名称
  13. std::string mItemName;
  14. //物品描述
  15. std::string mItemDesc;
  16. //VIP条件
  17. int mVipCondition;
  18. //兑换类型
  19. int mExchangeType;
  20. //所需道具id
  21. std::vector<int> mNeedItemId;
  22. //所花费话费卷数量(单位分)
  23. std::vector<int> mNeedItemCount;
  24. //道具ID(与ItemCFG.xld道具ID对应)
  25. std::vector<int> mItemId;
  26. //兑换物品数量
  27. std::vector<int> mItemCount;
  28. //显示资源ICON
  29. std::string mIcon;
  30. //次数类型
  31. int mTimeType;
  32. //服务器每日最大可兑换次数,0表示当天不限制
  33. int mExchangeMaxLimit;
  34. //类型
  35. int mType;
  36. //管理端
  37. int mManageMent;
  38. //管理端名称显示
  39. std::string mManageMentName;
  40. //显示折扣Discount
  41. int mDiscount;
  42. //返还贡献
  43. int mReturnContribution;
  44. };
  45. class M_ExchangeCFG
  46. {
  47. public:
  48. private:
  49. static std::auto_ptr<M_ExchangeCFG> msSingleton;
  50. public:
  51. int GetCount();
  52. const M_ExchangeCFGData* GetData(int ChangeId);
  53. boost::unordered_map<int, M_ExchangeCFGData>& GetMapData();
  54. void Reload();
  55. void Load(const std::string& path);
  56. void Load();
  57. static M_ExchangeCFG* GetSingleton();
  58. private:
  59. boost::unordered_map<int, M_ExchangeCFGData> mMapData;
  60. };