M_hero.h 746 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #pragma once
  2. #include <boost/unordered_map.hpp>
  3. #include <vector>
  4. struct M_heroData
  5. {
  6. //ID
  7. int mID;
  8. //英雄名称
  9. std::string mname;
  10. //英雄品质
  11. int mgrade_type;
  12. //默认拥有
  13. int mdefault_have;
  14. //技能
  15. int mskill_id;
  16. //属性
  17. int mattribute;
  18. //攻击力
  19. int matk;
  20. //英雄图标
  21. std::string micon;
  22. //英雄形象
  23. std::string maspect;
  24. //移动速度
  25. float mspeed;
  26. //缩放倍数
  27. float mzoom_factor;
  28. };
  29. class M_hero
  30. {
  31. public:
  32. private:
  33. static std::auto_ptr<M_hero> msSingleton;
  34. public:
  35. int GetCount();
  36. const M_heroData* GetData(int ID);
  37. boost::unordered_map<int, M_heroData>& GetMapData();
  38. void Reload();
  39. void Load(const std::string& path);
  40. void Load();
  41. static M_hero* GetSingleton();
  42. private:
  43. boost::unordered_map<int, M_heroData> mMapData;
  44. };