CSCommon: MMatchShop.h 소스 파일

MAIET

MMatchShop.h

00001 #ifndef _MMATCHSHOP_H
00002 #define _MMATCHSHOP_H
00003 
00004 #include "winsock2.h"
00005 #include "MXml.h"
00006 #include "MUID.h"
00007 #include <map>
00008 #include <vector>
00009 #include <algorithm>
00010 using namespace std;
00011 
00012 #include "MMatchItem.h"
00013 
00014 class MMatchShop
00015 {
00016 private:
00017 protected:
00018     vector<MMatchItemDesc*>     m_ItemDescVector;
00019     map<unsigned long int, MMatchItemDesc*> m_ItemDescMap;
00020 
00021     void ParseSellItem(MXmlElement& element);
00022     bool ReadXml(const char* szFileName);
00023 public:
00024     MMatchShop();
00025     virtual ~MMatchShop();
00026     bool Create(const char* szDescFileName);
00027     void Destroy();
00028 
00029     void Clear();
00030     vector<MMatchItemDesc*>*    GetItemVector() { return &m_ItemDescVector; }
00031     int GetCount() { return (int)m_ItemDescVector.size(); }
00032     bool IsSellItem(const unsigned long int nItemID);       // 해당 아이템을 팔고 있는지 여부
00033     MMatchItemDesc* GetSellItem(int nListIndex);            // 샵에서 팔고 있는 nListIndex번째 아이템 명세 반환
00034 
00035     static MMatchShop* GetInstance();
00036 };
00037 
00038 inline MMatchShop* MGetMatchShop() { return MMatchShop::GetInstance(); }
00039 
00040 #define MTOK_SELL           "SELL"
00041 #define MTOK_SELL_ITEMID    "itemid"
00042 
00043 
00044 
00045 
00046 
00047 #endif


MAIET entertainment