Fish_DropGoldCFG.h 689 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #pragma once
  2. #include <boost/unordered_map.hpp>
  3. #include <vector>
  4. struct Fish_DropGoldCFGData
  5. {
  6. //ID
  7. int mID;
  8. //资源类型
  9. int mResType;
  10. //资源名字
  11. std::string mResName;
  12. //资源路径
  13. std::string mResPath;
  14. //宽度
  15. int mWidth;
  16. //高度
  17. int mHeight;
  18. //缩放
  19. float mScale;
  20. };
  21. class Fish_DropGoldCFG
  22. {
  23. public:
  24. private:
  25. static std::auto_ptr<Fish_DropGoldCFG> msSingleton;
  26. public:
  27. int GetCount();
  28. const Fish_DropGoldCFGData* GetData(int ID);
  29. boost::unordered_map<int, Fish_DropGoldCFGData>& GetMapData();
  30. void Reload();
  31. void Load(const std::string& path);
  32. void Load();
  33. static Fish_DropGoldCFG* GetSingleton();
  34. private:
  35. boost::unordered_map<int, Fish_DropGoldCFGData> mMapData;
  36. };