M_hero.h 694 B

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