Fish_LuckyDrawCFG.h 781 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #pragma once
  2. #include <boost/unordered_map.hpp>
  3. #include <vector>
  4. struct Fish_LuckyDrawCFGData
  5. {
  6. //索引
  7. int mIndex;
  8. //价值校验值
  9. std::vector<int> mPinValue;
  10. //类型
  11. int mStarLvl;
  12. //物品类型
  13. int mItemType;
  14. //物品数量
  15. int mItemCount;
  16. //道具价值
  17. int mItemValue;
  18. //普通概率
  19. std::vector<int> mNormalProb;
  20. //无彩券概率
  21. std::vector<int> mNoChipProb;
  22. };
  23. class Fish_LuckyDrawCFG
  24. {
  25. public:
  26. private:
  27. static std::auto_ptr<Fish_LuckyDrawCFG> msSingleton;
  28. public:
  29. int GetCount();
  30. const Fish_LuckyDrawCFGData* GetData(int Index);
  31. boost::unordered_map<int, Fish_LuckyDrawCFGData>& GetMapData();
  32. void Reload();
  33. void Load(const std::string& path);
  34. void Load();
  35. static Fish_LuckyDrawCFG* GetSingleton();
  36. private:
  37. boost::unordered_map<int, Fish_LuckyDrawCFGData> mMapData;
  38. };