71 lines
1.3 KiB
C++
71 lines
1.3 KiB
C++
|
|
#pragma once
|
|
|
|
#include <toolkit/khash.h>
|
|
//#include <vector>
|
|
|
|
#include "SoundResource.h"
|
|
|
|
class SSoundResourceDB
|
|
{
|
|
protected:
|
|
KHash< SoundResource*, hashPr_mod_int> m_hashSoundResource;
|
|
|
|
void Init();
|
|
void Destroy();
|
|
void Load();
|
|
public:
|
|
const char* GetSoundResourceName( int nSoundID );
|
|
public:
|
|
SSoundResourceDB();
|
|
~SSoundResourceDB();
|
|
};
|
|
|
|
class SEffectResourceDB
|
|
{
|
|
private:
|
|
KHash< EffectResource*, hashPr_mod_int> m_hashEffectResource;
|
|
|
|
void Init();
|
|
void Destroy();
|
|
void Load();
|
|
public:
|
|
const char* GetEffectResourceName( int nEffectID );
|
|
public:
|
|
SEffectResourceDB();
|
|
~SEffectResourceDB();
|
|
};
|
|
|
|
class STextureResourceDB
|
|
{
|
|
private:
|
|
KHash< TextureResource*, hashPr_mod_int> m_hashTextureResource;
|
|
|
|
void Init();
|
|
void Destroy();
|
|
void Load();
|
|
public:
|
|
const char* GetTextureResourceName( int nTextureID );
|
|
public:
|
|
STextureResourceDB();
|
|
~STextureResourceDB();
|
|
};
|
|
|
|
class SResourceDB
|
|
{
|
|
private:
|
|
SSoundResourceDB m_SoundResDB;
|
|
SEffectResourceDB m_EffectResDB;
|
|
STextureResourceDB m_TextureResDB;
|
|
public:
|
|
const char* GetSoundResourceName( int nSoundID );
|
|
const char* GetEffectResourceName( int nEffectID );
|
|
const char* GetTextureResourceName( int nTextureID );
|
|
public:
|
|
SResourceDB();
|
|
~SResourceDB();
|
|
|
|
static SResourceDB* m_pThis;
|
|
};
|
|
|
|
SResourceDB & GetResourceDB(); |