***付费内容***
C++源码(武侠世界)
INT _ITEM::GetItemParamValue(UINT Start,const ItemParamValue& ipv)
{
INT TotalSize = sizeof(INT)*MAX_ITEM_PARAM;
INT nSize;
switch(ipv)
{
case IPV_CHAR:
{
nSize = 1;
if( Start > ((UINT)TotalSize - (UINT)nSize) )
{
Assert(FALSE);
}
return *((CHAR*)m_Param+Start);
}
break;
case IPV_SHORT:
{
nSize = 2;
if( Start > ( (UINT)TotalSize - (UINT)nSize ) )
{
Assert(FALSE);
}
return *((SHORT*)((CHAR*)m_Param+Start));
}
break;
case IPV_INT:
{
nSize = 4;
if( Start > ( (UINT)TotalSize - (UINT)nSize ) )
{
Assert(FALSE);
}
return *((INT*)((CHAR*)m_Param+Start));
}
break;
default:
Assert(FALSE);
}
return -1;
}
剩余 40% 内容需要支付 50.00
金币 后可完整阅读
支持付费阅读,激励作者创作更好的作品。
|