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


C++ TObjectIterator::IsA方法代码示例

本文整理汇总了C++中TObjectIterator::IsA方法的典型用法代码示例。如果您正苦于以下问题:C++ TObjectIterator::IsA方法的具体用法?C++ TObjectIterator::IsA怎么用?C++ TObjectIterator::IsA使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TObjectIterator的用法示例。


在下文中一共展示了TObjectIterator::IsA方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: FComponentReregisterContext

FGlobalComponentReregisterContext::FGlobalComponentReregisterContext(const TArray<UClass*>& ExcludeComponents)
{
	ActiveGlobalReregisterContextCount++;

	// wait until resources are released
	FlushRenderingCommands();

	// Detach only actor components that are not in the excluded list
	for(TObjectIterator<UActorComponent> ComponentIt;ComponentIt;++ComponentIt)
	{
		bool bShouldReregister=true;
		for( int32 Idx=0; Idx < ExcludeComponents.Num(); Idx++ )
		{
			UClass* ExcludeClass = ExcludeComponents[Idx];
			if( ExcludeClass &&
				ComponentIt->IsA(ExcludeClass) )
			{
				bShouldReregister = false;
				break;
			}
		}
		if( bShouldReregister )
		{
			new(ComponentContexts) FComponentReregisterContext(*ComponentIt);		
		}
	}
}
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:27,代码来源:ActorComponent.cpp

示例2: Exec

UBOOL FExecHook::Exec( const TCHAR* Cmd, FOutputDevice& Ar )
{
    if( ParseCommand(&Cmd,TEXT("ShowLog")) )
    {
        if( GLogWindow )
        {
            GLogWindow->Show(1);
            SetFocus( *GLogWindow );
            GLogWindow->Display.ScrollCaret();
        }
        return TRUE;
    }
    else if( ParseCommand(&Cmd,TEXT("TakeFocus")) )
    {
        TObjectIterator<UEngine> EngineIt;
        if( EngineIt && EngineIt->Client && EngineIt->Client->Viewports.Num() )
        {
            SetForegroundWindow( (HWND)EngineIt->Client->Viewports(0)->GetWindow() );
        }
        return TRUE;
    }
    else if( ParseCommand(&Cmd,TEXT("EditActor")) )
    {
        UClass* Class;
        TObjectIterator<UEngine> EngineIt;
        if( EngineIt && ParseObject<UClass>( Cmd, TEXT("Class="), Class, ANY_PACKAGE ) )
        {
            const AActor* Player  = EngineIt->Client ? EngineIt->Client->Viewports(0)->Actor : NULL;
            const AActor* Found   = NULL;
            FLOAT   MinDist = 999999.0f;
            for( TObjectIterator<AActor> It; It; ++It )
            {
                FLOAT Dist = Player ? FDist(It->Location,Player->Location) : 0.0f;
                if( (!Player || It->GetLevel()==Player->GetLevel()) &&  (!It->bDeleteMe) && (It->IsA( Class) ) && (Dist<MinDist) )
                {
                    MinDist = Dist;
                    Found   = *It;
                }
            }
            if( Found )
            {
                WObjectProperties* P = new WObjectProperties( TEXT("EditActor"), 0, TEXT(""), NULL, 1 );
                P->OpenWindow( (HWND)EngineIt->Client->Viewports(0)->GetWindow() );
                P->Root.SetObjects( (UObject**)&Found, 1 );
                P->Show(1);
            }
            else Ar.Logf( TEXT("Actor not found") );
        }
        else Ar.Logf( TEXT("Missing class") );
        return TRUE;
    }
    else if( ParseCommand(&Cmd,TEXT("HideLog")) )
    {
        if( GLogWindow )
        {
            GLogWindow->Show(0);
        }
        return TRUE;
    }
    else if( ParseCommand(&Cmd,TEXT("Preferences")) && !GIsClient )
    {
        if( !m_pPreferences )
        {
            m_pPreferences = new WConfigProperties( TEXT("Preferences"), LocalizeGeneral("AdvancedOptionsTitle",TEXT("Window")) );
            m_pPreferences->SetNotifyHook( this );
            m_pPreferences->OpenWindow( GLogWindow ? GLogWindow->hWnd : NULL );
            m_pPreferences->ForceRefresh();
        }
        assert(m_pPreferences);
        m_pPreferences->Show(TRUE);
        SetFocus( *m_pPreferences );
        return TRUE;
    }
    return FALSE;
}
开发者ID:mkentie,项目名称:DeusExe,代码行数:75,代码来源:ExecHook.cpp


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