本文整理汇总了C++中CBaseEntity::GetCompositeType方法的典型用法代码示例。如果您正苦于以下问题:C++ CBaseEntity::GetCompositeType方法的具体用法?C++ CBaseEntity::GetCompositeType怎么用?C++ CBaseEntity::GetCompositeType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBaseEntity
的用法示例。
在下文中一共展示了CBaseEntity::GetCompositeType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetGame
CEntityGroup& CEntityGroup::operator=(CEntityGroup& right)
{
CBaseEntity::operator=(right);
if(this != &right)
{
m_GUID = right.m_GUID;
map<CGUID, CBaseEntity*>::iterator itr = m_mapEntityGroup.begin();
for(; itr != m_mapEntityGroup.end(); itr++)
{
SAFE_DELETE(itr->second);
}
m_mapEntityGroup.clear();
itr = right.m_mapEntityGroup.begin();
for(; itr != right.m_mapEntityGroup.end(); itr++)
{
CBaseEntity* tGoods = GetGame()->GetEntityManager()->NewBaseEntity(itr->second->GetCompositeFlag(), itr->first);
if(itr->second->GetCurDbOperFlag())
{
if(tGoods->GetCompositeType() == COM_COMPOSITE)
*((CEntityGroup*)tGoods) = *((CEntityGroup*)(itr->second));
else
*((CEntity*)tGoods) = *((CEntity*)(itr->second));
}
m_mapEntityGroup[itr->first] = tGoods;
}
m_mapGuidByComFlag = right.m_mapGuidByComFlag;
m_lLeafComType = right.m_lLeafComType;
m_lLeafComFlag = right.m_lLeafComFlag;
// 其父节点的子类型区分的数据库变量名
m_strDetailComPositeFlagName = right.m_strDetailComPositeFlagName;
m_lDetailComPositeFlagType = right.m_lDetailComPositeFlagType;
m_bHasDetailLeavesFlag = right.m_bHasDetailLeavesFlag;
memcpy(m_szName, right.m_szName, sizeof(m_szName));
m_SessionID = right.m_SessionID;
m_DeleteLeafGuid = right.m_DeleteLeafGuid;
m_strDelLeafComFlag = right.m_strDelLeafComFlag;
QueryDataRelease();
vector<CTempEntityProperty*>::iterator epItr = right.m_pQueryDataMgr.begin();
for(; epItr != right.m_pQueryDataMgr.end(); epItr++)
{
CTempEntityProperty* pEP = new CTempEntityProperty((*epItr)->GetVarName(), (*epItr)->GetDataType());
*pEP = *(*epItr);
m_pQueryDataMgr.push_back(pEP);
}
RetQueryDataRelease();
epItr = right.m_pRetQueryDataMgr.begin();
for(; epItr != right.m_pRetQueryDataMgr.end(); epItr++)
{
CTempEntityProperty* pEP = new CTempEntityProperty((*epItr)->GetVarName(), (*epItr)->GetDataType());
*pEP = *(*epItr);
m_pRetQueryDataMgr.push_back(pEP);
}
m_bIsFindByName = right.m_bIsFindByName;
m_strProcedureName = right.m_strProcedureName;
}
return *this;
}
示例2: GetFromByteArray
//.........这里部分代码省略.........
}
}
//////////////////////////////////////////////////////////////////////////
// 是否有数据标志位
bool isLoadFlag = false;
WORD num = _GetWordFromByteArray(msgBuf, msgBufPos, bufSize);
if(num)
{
for(int j=0; j<num; j++)
{
BYTE entityType = _GetByteFromByteArray(msgBuf, msgBufPos, bufSize);
char comFlag[64];
memset(comFlag, 0, sizeof(comFlag));
_GetStringFromByteArray(msgBuf, msgBufPos, comFlag, bufSize);
CGUID guid;
_GetBufferFromByteArray(msgBuf, msgBufPos, guid, bufSize);
BYTE DbOperFlag = _GetByteFromByteArray(msgBuf, msgBufPos, bufSize);
BYTE DBOperType = _GetByteFromByteArray(msgBuf, msgBufPos, bufSize);
if(DBOperType == DB_OPER_LOAD || DBOperType == DB_OPER_LOAD_NOCACHE)
isLoadFlag = true;
if(DbOperFlag != 1) continue;
switch(DBOperType)
{
case DB_OPER_DELETE_INSERT:
case DB_OPER_ONLY_MEMSAVE:
{
CBaseEntity* pEntity = GetChild(guid);
if(pEntity)
{
if(pEntity->GetCompositeType() == COM_COMPOSITE)
{
if(!((CEntityGroup*)pEntity)->GetHasDetailLeavesFlag())// 非分层group(GoodsGroup)
{
ReleaseLeaf(guid);
pEntity = GetGame()->GetEntityManager()->NewBaseEntity(comFlag, guid);
AddChild(pEntity);
}
}
}
else
{
pEntity = GetGame()->GetEntityManager()->NewBaseEntity(comFlag, guid);
AddChild(pEntity);
}
if(pEntity)
{
pEntity->SetCurDbOperType(DBOperType);
pEntity->SetCurDbOperFlag(DbOperFlag);
if(DbOperFlag == 1)
{
pEntity->GetFromByteArray(msgBuf, msgBufPos, bufSize);
}
}
}
break;
case DB_OPER_DELETE:
{
CBaseEntity* pEntity = GetChild(guid);
if(!pEntity)
{
pEntity = GetGame()->GetEntityManager()->NewBaseEntity(comFlag, guid);