本文整理汇总了C++中CBaseObject类的典型用法代码示例。如果您正苦于以下问题:C++ CBaseObject类的具体用法?C++ CBaseObject怎么用?C++ CBaseObject使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CBaseObject类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RecurseDumpGraph
void CObjects::RecurseDumpGraph(CChars* psz, CEmbeddedObject* pcIncoming, int iLevel, BOOL bEmbedded)
{
CObject* pcObject;
CArrayTemplateEmbeddedObjectPtr apcTos;
int i;
CEmbeddedObject* pcToObject;
CBaseObject* pcEmbeddedObject;
CBaseObject* pcBaseObject;
if (!pcIncoming->IsBaseObject())
{
return;
}
pcBaseObject = (CBaseObject*)pcIncoming;
psz->Append(' ', iLevel * 3);
if ((pcBaseObject->miFlags & OBJECT_FLAGS_DUMPED) || (pcBaseObject->miDistToRoot < iLevel))
{
psz->Append('*');
pcBaseObject->PrintObject(psz, bEmbedded);
psz->AppendNewLine();
return;
}
else
{
psz->Append(' ');
pcBaseObject->PrintObject(psz, bEmbedded);
psz->AppendNewLine();
}
pcBaseObject->miFlags |= OBJECT_FLAGS_DUMPED;
apcTos.Init(1);
pcBaseObject->BaseGetPointerTos(&apcTos);
for (i = 0; i < apcTos.NumElements(); i++)
{
pcToObject = *apcTos.Get(i);
RecurseDumpGraph(psz, pcToObject, iLevel+1, FALSE);
}
if (pcBaseObject->IsObject())
{
pcObject = (CObject*)pcBaseObject;
for (i = 0; i < pcObject->mapEmbedded.NumElements(); i++)
{
pcEmbeddedObject = *pcObject->mapEmbedded.Get(i);
RecurseDumpGraph(psz, pcEmbeddedObject, iLevel, TRUE);
}
}
apcTos.Kill();
}
示例2: PreInit
void CBaseObject::PreInit(void)
{
CBaseObject* pcContainer;
#ifdef DEBUG
ValidateHasClass();
#endif
pcContainer = GetEmbeddingContainer();
pcContainer->ContainerPreInit();
}
示例3: IsValidPlacement
//-----------------------------------------------------------------------------
// Purpose: Move the placement model to the current position. Return false if it's an invalid position
//-----------------------------------------------------------------------------
bool CTFWeaponBuilder::IsValidPlacement( void )
{
if ( !m_hObjectBeingBuilt )
return false;
CBaseObject *pObj = m_hObjectBeingBuilt.Get();
pObj->UpdatePlacement();
return m_hObjectBeingBuilt->IsValidPlacement();
}
示例4: IRelationPriority
//------------------------------------------------------------------------------
// Purpose : Hate sentryguns more than other types of objects
//------------------------------------------------------------------------------
int CNPC_Bug_Warrior::IRelationPriority( CBaseEntity *pTarget )
{
if ( pTarget->Classify() == CLASS_MILITARY )
{
CBaseObject* pBaseObject = dynamic_cast<CBaseObject*>(pTarget);
if ( pBaseObject && pBaseObject->IsSentrygun() )
return ( BaseClass::IRelationPriority ( pTarget ) + 1 );
}
return BaseClass::IRelationPriority ( pTarget );
}
示例5: UpdateSentrygunTechnology
//-----------------------------------------------------------------------------
// Purpose: Tell all sentryguns what level of technology the Defender has
//-----------------------------------------------------------------------------
void CPlayerClassDefender::UpdateSentrygunTechnology( void )
{
for (int i = 0; i < m_pPlayer->GetObjectCount(); i++)
{
CBaseObject *pObj = m_pPlayer->GetObject(i);
if ( pObj && pObj->IsSentrygun() )
{
CObjectSentrygun *pSentry = static_cast<CObjectSentrygun *>(pObj);
pSentry->SetTechnology( m_bHasSmarterSentryguns, m_bHasSensorSentryguns );
}
}
}
示例6: ClearValidationFlags
void CObjects::ClearValidationFlags(void)
{
SIndexesIterator sIter;
CBaseObject* pcBaseObject;
pcBaseObject = mcMemory.StartIteration(&sIter);
while (pcBaseObject)
{
pcBaseObject->SetFlag(OBJECT_FLAGS_TESTED_FOR_SANITY, FALSE);
pcBaseObject = mcMemory.Iterate(&sIter);
}
}
示例7: GetActor
void C3DCanvas::ZoomAll()
{
m_bNeedUpdate = true;
CBaseObject* pObject = GetActor();
if(pObject!=0)
{
m_bNeedUpdate = true;
IViewClippingObject* pViewObject = pObject->GetViewClippingObject();
float fRadius = pViewObject->GetRadius();
m_camera.ZoomSphere(CShapeSphere(Vector3(0,fRadius/2,0), fRadius));
}
}
示例8: KillDontFreeObjects
void CObjects::KillDontFreeObjects(CArrayBlockObjectPtr* papcObjectPts)
{
int i;
CBaseObject* pcBaseObject;
int iNumElements;
iNumElements = papcObjectPts->NumElements();
for (i = 0; i < iNumElements; i++)
{
pcBaseObject = (CBaseObject*)(*papcObjectPts->Get(i));
pcBaseObject->KillDontFree();
}
}
示例9: SetFlag
void CObject::SetFlag(int iFlag, int iFlagValue)
{
int i;
CBaseObject* pcBaseObject;
::SetFlag(&miFlags, iFlag, iFlagValue);
for (i = 0; i < mapEmbedded.NumElements(); i++)
{
pcBaseObject = *mapEmbedded.Get(i);
pcBaseObject->SetFlag(iFlag, iFlagValue);
}
}
示例10: FindChildGoods
// 查找子goods
CBaseObject* CBaseObject::FindChildGoods(const CGUID& guExID)
{
itBaseObject it;
for (it = m_listObject.begin(); it != m_listObject.end(); it++)
{
CBaseObject* pObject = (*it);
if (pObject->GetType() == TYPE_GOODS && pObject->GetExID() == guExID)
{
return pObject;
}
}
return NULL;
}
示例11: FindChildObject
CBaseObject* CBaseObject::FindChildObject(const CGUID & guid)
{
itBaseObject it;
for (it = m_listObject.begin(); it != m_listObject.end(); ++it)
{
CBaseObject* pObject = (*it);
if (pObject && pObject->GetExID() == guid)
{
return pObject;
}
}
return NULL;
}
示例12: ComputeRespawnCount
//-----------------------------------------------------------------------------
// Compute the number of respawn stations on this team
//-----------------------------------------------------------------------------
int CSensorTFTeam::ComputeRespawnCount()
{
int nCount = 0;
for (int i = m_pTeam->GetNumObjects(); --i >= 0; )
{
CBaseObject *pObject = m_pTeam->GetObject(i);
if ( pObject && (pObject->GetType() == OBJ_RESPAWN_STATION) )
{
++nCount;
}
}
return nCount;
}
示例13: AttachObject
//-----------------------------------------------------------------------------
// Purpose: Find nearby objects and buff them.
//-----------------------------------------------------------------------------
void CObjectBuffStation::BuffNearbyObjects( CBaseObject *pObjectToTarget, bool bPlacing )
{
// ROBIN: Disabled object buffing for now
return;
// Check for a team.
if ( !GetTFTeam() )
return;
// Am I ready to power anything?
if ( IsBuilding() || ( !bPlacing && IsPlacing() ) )
return;
// Am I already full?
if ( m_nObjectCount >= BUFF_STATION_MAX_OBJECTS )
return;
// Do we have a specific target?
if ( pObjectToTarget )
{
if( !pObjectToTarget->CanBeHookedToBuffStation() || pObjectToTarget->GetBuffStation() )
return;
if ( IsWithinBuffRange( pObjectToTarget ) )
{
AttachObject( pObjectToTarget, bPlacing );
}
}
else
{
// Find nearby objects
for ( int iObject = 0; iObject < GetTFTeam()->GetNumObjects(); iObject++ )
{
CBaseObject *pObject = GetTFTeam()->GetObject( iObject );
assert(pObject);
if ( pObject == this || !pObject->CanBeHookedToBuffStation() || pObject->GetBuffStation() )
continue;
// Make sure it's within range
if ( IsWithinBuffRange( pObject ) )
{
AttachObject( pObject, bPlacing );
// Am I now full?
if ( m_nObjectCount >= BUFF_STATION_MAX_OBJECTS )
break;
}
}
}
}
示例14: switch
bool CGolem_Light::CheckCollision(IUnitInterface* pBase, bool nCanHandleCollision)
{
if(!pBase || pBase == this || this->GetLayerLocation() != pBase->GetLayerLocation())
return false;
//If the base collides with an object or entity leave
bool Collided = CBaseGolem::CheckCollision(pBase, nCanHandleCollision);
if(Collided)
return Collided;
//Do Light Golem specific Collisions
switch(pBase->m_nUnitType)
{
case OBJECT_TILE:
{
CBaseObject* temp = (CBaseObject*)pBase;
if( temp->GetType() == OBJ_WATER )
{
if(((CWaterTile*)temp)->IsFrozen())
{
return false;
}
return true;
}
}
break;
case OBJECT_OBJECT:
{
CBaseObject* temp = (CBaseObject*)pBase;
}
break;
case OBJECT_ENTITY:
{
//Entities cannot walk-thro other entities
if(!nCanHandleCollision)
return true;
CBaseEntity* temp = (CBaseEntity*)pBase;
if(temp->GetType() == ENT_GOLEM)
{
CBaseGolem* temp = (CBaseGolem*)pBase;
}
return true;
}
break;
};
return false;
}
示例15: ClearTouchedFlags
void CDistCalculatorParameters::ClearTouchedFlags(void)
{
int i;
int iNumTouched;
CBaseObject* pcBaseObject;
iNumTouched = NumTouched();
for (i = 0; i < iNumTouched; i++)
{
pcBaseObject = GetTouched(i);
pcBaseObject->ClearDistTouchedFlags();
}
}