1234567891011121314151617181920212223242526272829303132333435 |
- #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;
- };
- 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;
- };
|