12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- #pragma once
- #include <boost/unordered_map.hpp>
- #include <vector>
- struct M_equipmentData
- {
- //ID
- int mID;
- //装备类型
- int mitemType;
- //装备等级
- int mleve;
- //装备品质
- std::string mquality;
- //所需材料(道具ID,数量)
- std::vector<int> mcost1;
- //所需材料(道具ID,数量)
- std::vector<int> mcost2;
- //奖励(道具ID,数量)
- std::vector<int> mreward;
- //攻击
- int matk;
- //生命
- int mhp;
- //攻击百分比
- int matkpct;
- //生命百分比
- int mhppct;
- //暴击百分比
- int mcrtpct;
- //移动百分比
- int mmovepct;
- };
- class M_equipment
- {
- public:
- private:
- static std::auto_ptr<M_equipment> msSingleton;
- public:
- int GetCount();
- const M_equipmentData* GetData(int ID);
- boost::unordered_map<int, M_equipmentData>& GetMapData();
- void Reload();
- void Load(const std::string& path);
- void Load();
- static M_equipment* GetSingleton();
- private:
- boost::unordered_map<int, M_equipmentData> mMapData;
- };
|