📄 gameicondictionary.h
字号:
//gameIconDictionary.h
/*/////////////////////////////////////////////////////////////////
李亦
2006-7-7
/*/////////////////////////////////////////////////////////////////
#ifndef _GAMEICONDICTIONARY_H_
#define _GAMEICONDICTIONARY_H_
#ifndef _PLATFORM_H_
#include "platform/platform.h"
#endif
#ifndef _GAMEICONDEFINE_H_
#include "gameIconDefine.h"
#endif
#ifndef _TNAMEDICTIONARY_H_
#include "rpg/core/tNameDictionary.h"
#endif
namespace RPG
{
class GameIconMan;
//---------------------------------------------------------------------------
/// Dictionary to keep track of dynamic fields on SimObject.
class GameIconDictionary
{
//friend class SimFieldDictionaryIterator;
public:
struct Entry
{
union
{
U32 uCmd;
U32 dwID;
};
U32 uIcon;
StringTableEntry pIDName;
StringTableEntry pName;
StringTableEntry pDesc;
//char *value;
//Entry *pHashNext;
};
private:
enum
{
HashTableSize = 128
};
//Entry *m_pHashTableByName [HashTableSize];
NameDictionary<Entry> m_iconDict;
//IDDictionary<Entry> m_iconIDDict;
public:
//static Entry *ms_pFreeList;
//static void FreeEntry(Entry *entry);
//static Entry *AllocEntry();
public:
GameIconDictionary();
~GameIconDictionary();
void RemoveGameIcon(StringTableEntry slotName);
Entry* InsertGameIcon(StringTableEntry slotName);
//void SetGameIcon(StringTableEntry slotName, U32 uCmd, U32 uIcon);
//bool GetGameIcon(StringTableEntry slotName, U32& uCmd, U32& uIcon);
Entry* GetGameIcon(StringTableEntry slotName);
};
///////////////////////////////////////////////////////////////////////////////////////////
//
inline GameIconDictionary::Entry *GameIconDictionary::InsertGameIcon(StringTableEntry slotName)
{
return m_iconDict.Insert(slotName);
}
inline GameIconDictionary::Entry *GameIconDictionary::GetGameIcon(StringTableEntry slotName)
{
return m_iconDict.Get(slotName);
}
inline void GameIconDictionary::RemoveGameIcon(StringTableEntry slotName)
{
m_iconDict.Remove(slotName);
}
};//namespace RPG
#endif //_GAMEICONDICTIONARY_H_
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -