#pragma once #include //#include #include "DungeonResource.h" struct DUNGEONRESOURCE_INFO { int m_nDungeonID; KHash< DungeonResource*, hashPr_mod_int> m_hashDungeonRes; const DungeonResource* Find( int nLocalFlag ); public: DUNGEONRESOURCE_INFO() : m_nDungeonID( 0 ) {} ~DUNGEONRESOURCE_INFO() { DungeonResource* pDungeonRes = NULL; bool res; res = m_hashDungeonRes.get_first_value( pDungeonRes ); while ( res ) { if ( pDungeonRes != NULL ) { delete pDungeonRes; } res = m_hashDungeonRes.get_next_value( pDungeonRes ); } m_hashDungeonRes.clear(); } }; class SDungeonResourceDB { protected: KHash< DUNGEONRESOURCE_INFO*, hashPr_mod_int> m_hashDungeonResInfo; void Init(); void Destroy(); void Load(); public: SDungeonResourceDB(); ~SDungeonResourceDB(); const DungeonResource* GetDungeonRes( int nID, int nLocalFlag ); const int GetDungeonNameID( int nID ); public: static SDungeonResourceDB* m_pThis; }; SDungeonResourceDB & GetDungeonResDB();