Fish_ArmatureCFG.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #pragma once
  2. #include <boost/unordered_map.hpp>
  3. #include <vector>
  4. struct Fish_ArmatureCFGData
  5. {
  6. //模型ID
  7. int mID;
  8. //名字
  9. std::string mName;
  10. //资源类型
  11. int mResType;
  12. //资源名字
  13. std::string mResName;
  14. //资源路径
  15. std::string mResPath;
  16. //移动动作
  17. std::string mMoveAction;
  18. //死亡动作
  19. std::string mDieAction;
  20. //颜色
  21. int mColor;
  22. //缩放
  23. float mScale;
  24. //固定方向
  25. bool mEnableFlipped;
  26. //碰撞数据
  27. std::vector<float> mCollider;
  28. //附加动画
  29. std::vector<int> mAttachArmatures;
  30. //标记
  31. std::string mFixFlag;
  32. //光圈
  33. std::vector<std::string> mCircles;
  34. //附加粒子
  35. std::vector<std::string> mAttachParticles;
  36. };
  37. class Fish_ArmatureCFG
  38. {
  39. public:
  40. private:
  41. static std::auto_ptr<Fish_ArmatureCFG> msSingleton;
  42. public:
  43. int GetCount();
  44. const Fish_ArmatureCFGData* GetData(int ID);
  45. boost::unordered_map<int, Fish_ArmatureCFGData>& GetMapData();
  46. void Reload();
  47. void Load(const std::string& path);
  48. void Load();
  49. static Fish_ArmatureCFG* GetSingleton();
  50. private:
  51. boost::unordered_map<int, Fish_ArmatureCFGData> mMapData;
  52. };