本文整理汇总了C++中IObject::GetComponentType方法的典型用法代码示例。如果您正苦于以下问题:C++ IObject::GetComponentType方法的具体用法?C++ IObject::GetComponentType怎么用?C++ IObject::GetComponentType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IObject
的用法示例。
在下文中一共展示了IObject::GetComponentType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
CDatabaseSchema *CDatabaseManager::GetSchemaByFile( IHashString *hszSchemaFile )
{
CDatabaseSchema *retVal = NULL;
DWORD objectID = hszSchemaFile->GetUniqueID();
if( m_FilepathToObject.find( objectID ) != m_FilepathToObject.end() )
{
IObject *object = m_FilepathToObject[ objectID ];
if( object->GetComponentType()->GetUniqueID() == m_databaseSchemaComponentType.GetUniqueID() )
{
retVal = (CDatabaseSchema*)object;
}
}
return retVal;
}
示例2: Visit
bool CWorldVisitor::Visit( IComponent * component, bool bVisitEnter )
{
IObject *theObject;
IHashString *name;
IHashString *parentName;
IHashString *type;
StdString parentType;
StdString childType;
std::string str;
theObject = dynamic_cast<IObject *>(component);
// This shouldn't happen but it does for some odd reason....
assert(theObject);
if( theObject == NULL )
{
return false;
}
name = theObject->GetName();
parentName = theObject->GetParentName();
type = theObject->GetComponentType();
//Check to see if it is a valid object (for object exclusion)
if( !CheckObject( type->GetString() ) )
{
return true;
}
else
{
if ( name == NULL )
{
name = &CHashString(_T("NULL"));
}
if( bVisitEnter == true )
{
//if( (m_pArchiver != NULL) && ( _tcscmp( type->GetString(), _T("CPhysicsObject") ) != 0 ) )
if( (m_pArchiver != NULL) )
{
// Start the Node
m_pArchiver->StartClass( type->GetString() );
// Write out the Unique ID aka Name
m_pArchiver->Write( name->GetString(), _T("Name") );
theObject->Serialize( *m_pArchiver );
}
// Removal of CPhysShape and changes to CPhysicsObject
if( _tcscmp( type->GetString(), _T("CPhysicsObject") ) == 0 )
{
CPhysObjectStruct tmpCPhysObject;
StdString CPhyShapeFile;
StdString CPhyShapeFileOld;
// if it's parent is not a CTerrainSector Object
if( _tcsstr( name->GetString(), _T("Terrain") ) == NULL )
{
static DWORD msgHash_GetModelFileName = CHashString(_T("GetModelFileName")).GetUniqueID();
m_ToolBox->SendMessage(msgHash_GetModelFileName, sizeof(StdString*), &CPhyShapeFile, parentName, NULL );
CPhyShapeFile += _T(".psl");
}
// CTerrainSector Object
else
{
CPhyShapeFile = _T("maps\\terrain.psl");
}
IArchive *PhysObjectIn;
IArchive *PhysObjectRead;
CHashString memTypePhysObjectIn(_T("Memory"));
int PhysObjectInMemSize = 1024 * 1024 * sizeof(char);
char* PhysObjectInMemChunk = new char[PhysObjectInMemSize];
memset( PhysObjectInMemChunk, 0, PhysObjectInMemSize );
CREATEARCHIVE caPhysObjectIn;
caPhysObjectIn.mode = STREAM_MODE_READ;
caPhysObjectIn.streamData = PhysObjectInMemChunk;
caPhysObjectIn.streamSize = PhysObjectInMemSize;
caPhysObjectIn.streamType = &memTypePhysObjectIn;
static DWORD msgHash_CreateArchive = CHashString(_T("CreateArchive")).GetUniqueID();
if (m_ToolBox->SendMessage(msgHash_CreateArchive, sizeof(CREATEARCHIVE), &caPhysObjectIn) != MSG_HANDLED)
{
return true;
}
PhysObjectIn = caPhysObjectIn.archive;
CREATESTREAM csPhysObjectIn;
csPhysObjectIn.streamData = caPhysObjectIn.streamData;
csPhysObjectIn.streamSize = caPhysObjectIn.streamSize;
csPhysObjectIn.mode = STREAM_MODE_WRITE;
static DWORD msgHash_CreateStream_Memory = CHashString(_T("CreateStream_Memory")).GetUniqueID();
if (m_ToolBox->SendMessage(msgHash_CreateStream_Memory, sizeof(CREATESTREAM), &csPhysObjectIn) != MSG_HANDLED)
{
return true;
}
PhysObjectIn->Init(csPhysObjectIn.openStream);
//.........这里部分代码省略.........