当前位置: 首页>>代码示例>>C++>>正文


C++ CBaseObject类代码示例

本文整理汇总了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();
}
开发者ID:chrisjaquet,项目名称:Codaphela.Library,代码行数:54,代码来源:Objects.cpp

示例2: PreInit

void CBaseObject::PreInit(void)
{
	CBaseObject*	pcContainer;

#ifdef DEBUG
	ValidateHasClass();
#endif

	pcContainer = GetEmbeddingContainer();
	pcContainer->ContainerPreInit();
}
开发者ID:chrisjaquet,项目名称:Codaphela.Library,代码行数:11,代码来源:BaseObject.cpp

示例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();
}
开发者ID:MrBoomer568,项目名称:TF2Classic,代码行数:14,代码来源:tf_weapon_builder.cpp

示例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 );
}
开发者ID:RaisingTheDerp,项目名称:raisingthebar,代码行数:14,代码来源:npc_bug_warrior.cpp

示例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 );
		}
	}
}
开发者ID:RaisingTheDerp,项目名称:raisingthebar,代码行数:15,代码来源:tf_class_defender.cpp

示例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);
	}
}
开发者ID:chrisjaquet,项目名称:Codaphela.Library,代码行数:12,代码来源:Objects.cpp

示例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));
	}
}
开发者ID:LiXizhi,项目名称:NPLRuntime,代码行数:12,代码来源:3DCanvas.cpp

示例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();
	}
}
开发者ID:chrisjaquet,项目名称:Codaphela.Library,代码行数:13,代码来源:Objects.cpp

示例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);
	}
}
开发者ID:andrewpaterson,项目名称:Codaphela.Library,代码行数:13,代码来源:Object.cpp

示例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;
}
开发者ID:xiongshaogang,项目名称:mmo-resourse,代码行数:14,代码来源:BaseObject.cpp

示例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;
}
开发者ID:xiongshaogang,项目名称:mmo-resourse,代码行数:13,代码来源:BaseObject.cpp

示例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;
}
开发者ID:RaisingTheDerp,项目名称:raisingthebar,代码行数:16,代码来源:sensor_tf_team.cpp

示例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;
			}
		}
	}
}
开发者ID:Axitonium,项目名称:SourceEngine2007,代码行数:54,代码来源:tf_obj_buff_station.cpp

示例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;
}
开发者ID:Ethanthecrazy,项目名称:baf-labyrinth-game,代码行数:51,代码来源:CGolem_Light.cpp

示例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();
	}
}
开发者ID:andrewpaterson,项目名称:Codaphela.Library,代码行数:14,代码来源:DistCalculatorParameters.cpp


注:本文中的CBaseObject类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。