CSCommon: MMatchWorldItemDesc.h 소스 파일

MAIET

MMatchWorldItemDesc.h

00001 #ifndef _MMATCHWORLDITEMDESC_H
00002 #define _MMATCHWORLDITEMDESC_H
00003 
00004 #include "MXml.h"
00005 #include <map>
00006 using namespace std;
00007 
00008 #define WORLDITEM_NAME_LENGTH       256
00009 
00010 enum MMATCH_WORLD_ITEM_TYPE
00011 {
00012     WIT_HP          = 0,
00013     WIT_AP          = 1,
00014     WIT_BULLET      = 2,
00015     WIT_HPAP        = 3,
00016     WIT_CLIENT      = 4,    // 클라이언트 전용 월드아이템
00017 
00018     WIT_QUEST       = 5,    // 퀘스트 아이템 박스
00019     WIT_BOUNTY      = 6,    // 퀘스트에서 나오는 바운티 아이템
00020 
00021     WIT_END
00022 };
00023 
00024 
00025 struct MMatchWorldItemDesc
00026 {
00027     short                   m_nID;
00028     MMATCH_WORLD_ITEM_TYPE  m_nItemType;
00029     float                   m_fAmount;
00030     unsigned long int       m_nTime;
00031     char                    m_szModelName[WORLDITEM_NAME_LENGTH];
00032     char                    m_szDescName[WORLDITEM_NAME_LENGTH];
00033 };
00034 
00035 class MMatchWorldItemDescMgr;
00036 class MZFileSystem;
00037 
00038 
00040 class MMatchWorldItemDescMgr : public map<short, MMatchWorldItemDesc*>
00041 {
00042 private:
00043 protected:
00044     void ParseWorldItem(MXmlElement& element);
00045 public:
00046     MMatchWorldItemDescMgr();
00047     virtual ~MMatchWorldItemDescMgr();
00048     bool ReadXml(const char* szFileName);
00049     bool ReadXml(MZFileSystem* pFileSystem, const char* szFileName);
00050     void Clear();
00051     MMatchWorldItemDesc* GetItemDesc(short nID);
00052     static MMatchWorldItemDescMgr* GetInstance();
00053 };
00054 
00055 inline MMatchWorldItemDescMgr* MGetMatchWorldItemDescMgr() 
00056 { 
00057     return MMatchWorldItemDescMgr::GetInstance();
00058 }
00059 
00060 
00062 
00063 
00064 #include "MMatchWorldItem.h"
00065 #include "MMatchStage.h"
00066 
00067 #define MAX_WORLDITEM_SPAWN     100
00068 
00069 // 한 맵에서 가지고 있는 스폰정보
00070 struct MMatchMapsWorldItemSpawnInfoSet
00071 {
00072     MMatchWorldItemSpawnInfo    SoloSpawnInfo[MAX_WORLDITEM_SPAWN];
00073     MMatchWorldItemSpawnInfo    TeamSpawnInfo[MAX_WORLDITEM_SPAWN];
00074     int                         m_nSoloSpawnCount;
00075     int                         m_nTeamSpawnCount;
00076 };
00077 
00078 // 전체 맵의 스폰정보
00079 class MMatchMapsWorldItemSpawnInfo
00080 {
00081 private:
00082     void ParseSpawnInfo(MXmlElement& element, int nMapID);
00083     void SetMapsSpawnInfo(int nMapID, char* szGameTypeID, int nItemID, float x, float y, float z, 
00084                           unsigned long int nCoolTime);
00085     bool ReadXml(const char* szFileName, int nMapID);
00086 protected:
00087 public:
00088     MMatchMapsWorldItemSpawnInfoSet     m_MapsSpawnInfo[MMATCH_MAP_COUNT];
00089     MMatchMapsWorldItemSpawnInfo();
00090     virtual ~MMatchMapsWorldItemSpawnInfo();
00091     
00092     bool Read();
00093     void Clear();
00094     static MMatchMapsWorldItemSpawnInfo* GetInstance();
00095 };
00096 
00097 
00098 
00099 inline MMatchMapsWorldItemSpawnInfo* MGetMapsWorldItemSpawnInfo() 
00100 { 
00101     return MMatchMapsWorldItemSpawnInfo::GetInstance();
00102 }
00103 
00104 #endif


MAIET entertainment