Fish_ShopCFG.h 968 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #pragma once
  2. #include <boost/unordered_map.hpp>
  3. #include <vector>
  4. struct Fish_ShopCFGData
  5. {
  6. //key
  7. int mShopID;
  8. //物品id
  9. int mItemID;
  10. //数量
  11. int mItemCount;
  12. //消耗类型(1金币,2礼券,3月卡炮)
  13. int mConsumeType;
  14. //背包类型(1道具,2装备,3鱼雷,4鱼雷碎片,5灵珠,6宝箱)
  15. int mKnapsackType;
  16. //消耗数量
  17. int mConsumeCount;
  18. //是否开放
  19. std::vector<int> mShowType;
  20. //合成id
  21. int mSynthesisId;
  22. //是否支持VIP打折(0不打折)
  23. int mNeedVIP;
  24. //商店页面显示(0-vip,1-特惠,2-背包)
  25. int mShopTab;
  26. //能否发布
  27. int mRelease;
  28. //发布VIP等级
  29. int mReleaseVIP;
  30. //炮台id
  31. int mTurrestId;
  32. };
  33. class Fish_ShopCFG
  34. {
  35. public:
  36. private:
  37. static std::auto_ptr<Fish_ShopCFG> msSingleton;
  38. public:
  39. int GetCount();
  40. const Fish_ShopCFGData* GetData(int ShopID);
  41. boost::unordered_map<int, Fish_ShopCFGData>& GetMapData();
  42. void Reload();
  43. void Load(const std::string& path);
  44. void Load();
  45. static Fish_ShopCFG* GetSingleton();
  46. private:
  47. boost::unordered_map<int, Fish_ShopCFGData> mMapData;
  48. };