12345678910111213141516171819202122232425262728293031323334353637 |
- #pragma once
- #include <boost/unordered_map.hpp>
- #include <vector>
- struct M_itemData
- {
- //ID
- int mID;
- //物品名称
- std::string mname;
- //描述
- std::string mdesc;
- //类型
- int mtype;
- //品质
- int mquality;
- //图标
- std::string micon;
- //参数
- std::string mparam1;
- };
- class M_item
- {
- public:
- private:
- static std::auto_ptr<M_item> msSingleton;
- public:
- int GetCount();
- const M_itemData* GetData(int ID);
- boost::unordered_map<int, M_itemData>& GetMapData();
- void Reload();
- void Load(const std::string& path);
- void Load();
- static M_item* GetSingleton();
- private:
- boost::unordered_map<int, M_itemData> mMapData;
- };
|