Files
Leviathan/Client/Game/game/DB/SDungeonResourceDB.h
T
2026-06-01 12:46:52 +02:00

54 lines
1.0 KiB
C++

#pragma once
#include <toolkit/khash.h>
//#include <vector>
#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();