Fish_BulletCFG.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #pragma once
  2. #include <boost/unordered_map.hpp>
  3. #include <vector>
  4. struct Fish_BulletCFGData
  5. {
  6. //ID
  7. int mID;
  8. //子弹名字
  9. std::string mName;
  10. //子弹类型
  11. int mBulletType;
  12. //资源类型
  13. int mResType;
  14. //资源名字
  15. std::string mResName;
  16. //颜色
  17. int mColor;
  18. //缩放
  19. float mScale;
  20. //碰撞数据
  21. std::vector<float> mCollider;
  22. //子弹数量
  23. int mBulletCount;
  24. //击中类型
  25. int mHitType;
  26. //击中特效
  27. int mHitEffectID;
  28. //声音ID
  29. int mHitSoundID;
  30. //渔网特效
  31. int mNetEffect;
  32. //渔网直径
  33. int mNetSize;
  34. //渔网大小
  35. float mNetScale;
  36. //渔网数量
  37. int mNetCount;
  38. //渔网击中鱼次数
  39. int mNetHitCount;
  40. //子弹速度
  41. int mSpeed;
  42. //参数
  43. std::vector<int> mParam;
  44. //半径
  45. float mRadius;
  46. };
  47. class Fish_BulletCFG
  48. {
  49. public:
  50. private:
  51. static std::auto_ptr<Fish_BulletCFG> msSingleton;
  52. public:
  53. int GetCount();
  54. const Fish_BulletCFGData* GetData(int ID);
  55. boost::unordered_map<int, Fish_BulletCFGData>& GetMapData();
  56. void Reload();
  57. void Load(const std::string& path);
  58. void Load();
  59. static Fish_BulletCFG* GetSingleton();
  60. private:
  61. boost::unordered_map<int, Fish_BulletCFGData> mMapData;
  62. };