M_monster.h 777 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #pragma once
  2. #include <boost/unordered_map.hpp>
  3. #include <vector>
  4. struct M_monsterData
  5. {
  6. //ID
  7. int64_t mID;
  8. //怪物名称
  9. std::string mname;
  10. //怪物类型
  11. int mtype;
  12. //击杀倍数
  13. int mmultiple;
  14. //怪物图标
  15. std::string micon;
  16. //怪物形象
  17. std::string maspect;
  18. //移动速度
  19. float mspeed;
  20. //鱼阵移动速度
  21. float msuper_speed;
  22. //缩放倍数
  23. float mzoom_factor;
  24. //经验掉落(道具ID)
  25. int mexp_value;
  26. };
  27. class M_monster
  28. {
  29. public:
  30. private:
  31. static std::auto_ptr<M_monster> msSingleton;
  32. public:
  33. int GetCount();
  34. const M_monsterData* GetData(int64_t ID);
  35. boost::unordered_map<int64_t, M_monsterData>& GetMapData();
  36. void Reload();
  37. void Load(const std::string& path);
  38. void Load();
  39. static M_monster* GetSingleton();
  40. private:
  41. boost::unordered_map<int64_t, M_monsterData> mMapData;
  42. };