#pragma once
struct sItemInfo
{
enum
{
MaxItemCount = 30,
};
int nCurCount;
struct
{
int nItemCode;
int nItemCount;
}data[MaxItemCount];
};
class CLuaStruct
{
private:
union
{
sItemInfo item;
}m_data;
public:
CLuaStruct(void);
~CLuaStruct(void);
// 压入一个元组(nItemCode,nItemCount)
void PushItem(const int nItemCode,const int nItemCount);
// 清除数据
void Clear() { memset(&m_data,0,sizeof(m_data));}
// 获取道具信息
const sItemInfo& GetItemInfo()const { return m_data.item;};
};
extern CLuaStruct g_luaStruct;
|