#ifndef _SKILL_MGR_H_ #define _SKILL_MGR_H_ #define g_SkillMgr CSkillMgr::GetInstance() #include #include #include "SkillStructure.h" // Àü¹æ ÂüÁ¶ class CDelimitedFile; class CSkillMgr : public CSingleton { public: enum _Const { MAX_SKILL_LOCKCOUNT = 5, // ½ºÅ³ÀÇ ÃÖ´ë °³¼ö (ÀÌ °³¼ö¸¸Å­ ProtoTypeÀÌ Á¸ÀçÇÑ´Ù) MAX_SKILL_LEVEL = 6, // ½ºÅ³ ·¹º§ÀÇ ÇѰè MAX_SKILL_PER_STATUS = 16, // æƮ¿Í ÀÎæƮÀÇ °¡Áþ¼ö }; ~CSkillMgr(); void ClearProtoType(void); bool LoadSkillsFromFile(const char* szFileName = 0); bool LoadSkillsFromBinary(const char* szFileNameBinary = 0); bool SaveSkillsToBinary(const char* szFileNameBinary = 0, const char* szTrashFile = 0); const Skill::ProtoType* GetSkillProtoType(unsigned short usSkill_ID); void GetClassSkill(unsigned char cClass, unsigned short *arySkillID, unsigned char *cSkillNum); // ·Îµå ´ç½ÃÀÇ Ã¼Å©¼¶°ú, ÇöÀç µ¥ÀÌÅÍ·Î ¸¸µç üũ¼¶À» ºñ±³ÇÑ´Ù. // µ¥ÀÌÅͰ¡ ¹Ù²î¸é false¸¦ ¸®ÅÏÇÑ´Ù. bool CheckData(); private: CSkillMgr(); struct ProtoTypeArray { Skill::ProtoType m_ProtoTypes[MAX_SKILL_LOCKCOUNT]; inline bool operator < (ProtoTypeArray& rhs) { return m_ProtoTypes[0].m_usSkill_ID < rhs.m_ProtoTypes[0].m_usSkill_ID; } }; static const char* ms_szSkillScriptFileName; static CSkillMgr ms_this; ProtoTypeArray* m_ProtoTypeArray; size_t m_nSkillNum; unsigned long m_dwCRC32; // ¹®ÀÚ¿­°ú ºñ±³Çؼ­, ¾Ë¸ÂÀº ŸÀÔ °ªÀ» ¸®ÅÏÇÑ´Ù. ½ÇÆÐ½Ã nMaxTypeÀ» ¸®ÅÏÇÑ´Ù. unsigned char ReadStringToTypeValue(CDelimitedFile& DelimitedFile, const char* szColumn, const CTypeName* TypeArray, const unsigned char nMaxType); bool CheckParentChildRule(void); }; #endif