Beispiel #1
0
//called to enumerate the FX that this manager contains, and for each one it will query each
//key for the objects it uses, and for each object the provided callback will be called
//and provided with the effect, the object, and the provided user data
void CClientFXMgr::EnumerateObjects(CBaseFX::TEnumerateObjectsFn pfnObjectCB, void* pUserData)
{
	//don't allow for invalid functions!
	if(!pfnObjectCB)
		return;

	//iterate through all of our effects
	LTListIter<CClientFXInstance*> itFXInstance = m_FXInstanceList.Begin();
	while(itFXInstance != m_FXInstanceList.End())
	{
		CClientFXInstance* pInst = *itFXInstance;
		itFXInstance++;

		//now iterate through each key in that effect
		LTListIter<CBaseFX*> itActiveFX = pInst->m_ActiveFXList.Begin();
		while(itActiveFX != pInst->m_ActiveFXList.End())
		{
			CBaseFX* pFX = *itActiveFX;
			itActiveFX++;

			//and enumerate the objects used by that effect
			pFX->EnumerateObjects(pfnObjectCB, pUserData);
		}
	}
}