M_GiftCFG.h 679 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #pragma once
  2. #include <boost/unordered_map.hpp>
  3. #include <vector>
  4. struct M_GiftCFGData
  5. {
  6. //礼物ID
  7. int mGiftId;
  8. //所含金币
  9. int mCoin;
  10. //是否显示
  11. int misShow;
  12. //抽成百分比(/100)
  13. int mPercent;
  14. //所需VIP等级
  15. int mVip;
  16. //播放的动画
  17. std::string mAction;
  18. //物品美术字名字
  19. std::string mTextIcon;
  20. };
  21. class M_GiftCFG
  22. {
  23. public:
  24. private:
  25. static std::auto_ptr<M_GiftCFG> msSingleton;
  26. public:
  27. int GetCount();
  28. const M_GiftCFGData* GetData(int GiftId);
  29. boost::unordered_map<int, M_GiftCFGData>& GetMapData();
  30. void Reload();
  31. void Load(const std::string& path);
  32. void Load();
  33. static M_GiftCFG* GetSingleton();
  34. private:
  35. boost::unordered_map<int, M_GiftCFGData> mMapData;
  36. };