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


C++ IsPortActive函数代码示例

本文整理汇总了C++中IsPortActive函数的典型用法代码示例。如果您正苦于以下问题:C++ IsPortActive函数的具体用法?C++ IsPortActive怎么用?C++ IsPortActive使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: UpdateUIElement

void CFlashUIWorldScreenPosNode::ProcessEvent( EFlowEvent event, SActivationInfo *pActInfo )
{
    if ( event == eFE_Initialize )
    {
        UpdateUIElement( GetPortString( pActInfo, eI_UIElement ), pActInfo );
    }
    else if ( event == eFE_Activate )
    {
        if ( IsPortActive( pActInfo, eI_UIElement ) )
        {
            UpdateUIElement( GetPortString( pActInfo, eI_UIElement ), pActInfo );
        }

        if ( IsPortActive( pActInfo, eI_Get ) )
        {
            const int instanceId = GetPortInt(pActInfo, eI_InstanceID);
            Vec3 worldPos = GetPortVec3(pActInfo, eI_WorldPos);
            Vec3 offset = GetPortVec3(pActInfo, eI_Offset);
            const bool scaleMode = GetPortBool(pActInfo, eI_ScaleMode);

            SPerInstanceCall3< Vec3&, Vec3&, bool > caller;
            if ( !caller.Execute(GetElement(), instanceId, functor(*this, &CFlashUIWorldScreenPosNode::GetScreenPosFromWorld), worldPos, offset, scaleMode, false) )
            {
                UIACTION_WARNING( "FG: UIElement \"%s\" called get screenpos for multiple instances! (passed instanceId %i), referenced at node \"%s\"", GetPortString(pActInfo, eI_UIElement).c_str(), instanceId, pActInfo->pGraph->GetNodeTypeName( pActInfo->myID ) );
            }

            ActivateOutput( pActInfo, eO_ScreenPos, worldPos);
            ActivateOutput( pActInfo, eO_Scale, offset.z);
            ActivateOutput( pActInfo, eO_IsOnScreen, offset.x == 0 && offset.y == 0);
            offset.z = 0;
            ActivateOutput( pActInfo, eO_OverScanBorder, offset);
            ActivateOutput( pActInfo, eO_OnGet, true );
        }
    }
}
开发者ID:souxiaosou,项目名称:FireNET,代码行数:35,代码来源:FlashUIDisplayNodes.cpp

示例2: ProcessEvent

	virtual void ProcessEvent( EFlowEvent event, SActivationInfo *pActInfo )
	{
		switch (event)
		{
		case eFE_Initialize:
			break;
		case eFE_Activate:
      if (IsPortActive(pActInfo, EIP_Enable))
      {
          CActor* pLocalActor = static_cast<CActor*>(g_pGame->GetIGameFramework()->GetClientActor());
          if ( pLocalActor != NULL)
          {
            PlayerActor::Stumble::StumbleParameters stumbleParameters;
            stumbleParameters.minDamping   = GetPortFloat(pActInfo, EIP_MinDamping);
            stumbleParameters.maxDamping   = GetPortFloat(pActInfo, EIP_MaxDamping);

            stumbleParameters.periodicTime = GetPortFloat(pActInfo, EIP_PeriodicTime);
            stumbleParameters.strengthX    = GetPortFloat(pActInfo, EIP_StrengthX);
            stumbleParameters.strengthY    = GetPortFloat(pActInfo, EIP_StrengthY);
            stumbleParameters.randomness   = GetPortFloat(pActInfo, EIP_Randomness);

            pLocalActor->EnableStumbling(&stumbleParameters);
          }
      }
      else if (IsPortActive(pActInfo, EIP_Disable))
			{
        CActor* pLocalActor = static_cast<CActor*>(g_pGame->GetIGameFramework()->GetClientActor());
        if ( pLocalActor != NULL)
        {
          pLocalActor->DisableStumbling();
        }
			}
			break;
		}
	}
开发者ID:Kufusonic,项目名称:Work-in-Progress-Sonic-Fangame,代码行数:35,代码来源:FlowPlayerStumble.cpp

示例3: GetPortFloat

void CFlowNode_ScreenFader::ProcessActivateEvent(SActivationInfo* activationInformation)
{
	if (InputEntityIsLocalPlayer(activationInformation) == false)
		return;

	if (IsPortActive(activationInformation, eInputPorts_FadeIn))
	{
		const float fadeInTime = GetPortFloat(activationInformation, eInputPorts_FadeInTime);
		const Vec3 fadeColor = GetPortVec3(activationInformation, eInputPorts_FadeColor);
		const string texture = GetPortString(activationInformation, eInputPorts_Texture);
		const bool useCurrentColor = GetPortBool(activationInformation, eInputPorts_UseCurrentColor);
		ColorF color;
		color.Set(fadeColor.x, fadeColor.y, fadeColor.z);
		m_environment.GetGame().FadeInScreen(texture, color, fadeInTime, useCurrentColor);
	}
	else if (IsPortActive(activationInformation, eInputPorts_FadeOut))
	{
		const float fadeOutTime = GetPortFloat(activationInformation, eInputPorts_FadeOutTime);
		const Vec3 fadeColor = GetPortVec3(activationInformation, eInputPorts_FadeColor);
		const string texture = GetPortString(activationInformation, eInputPorts_Texture);
		const bool useCurrentColor = GetPortBool(activationInformation, eInputPorts_UseCurrentColor);
		ColorF color;
		color.Set(fadeColor.x, fadeColor.y, fadeColor.z);
		m_environment.GetGame().FadeOutScreen(texture, color, fadeOutTime, useCurrentColor);	
	}

}
开发者ID:aronarts,项目名称:FireNET,代码行数:27,代码来源:ScreenFaderNode.cpp

示例4: ProcessEvent

	virtual void ProcessEvent( EFlowEvent event, SActivationInfo *pActInfo )
	{
		switch (event)
		{
		case eFE_Activate:
			{
				CPlayer* pClientPlayer = (CPlayer*)g_pGame->GetIGameFramework()->GetClientActor();
				if (pClientPlayer)
				{
					if (IsPortActive(pActInfo, INP_ENABLE))
					{
						if (gEnv->IsCutscenePlaying())
							pClientPlayer->GetPlayerHealthGameEffect().SetActive( true );  
						pClientPlayer->GetPlayerHealthGameEffect().ExternalSetEffectIntensity( GetPortFloat( pActInfo, INP_INTENSITY ));
						pClientPlayer->GetPlayerHealthGameEffect().EnableExternalControl( true );
					}
					if (IsPortActive(pActInfo, INP_INTENSITY))
						pClientPlayer->GetPlayerHealthGameEffect().ExternalSetEffectIntensity( GetPortFloat( pActInfo, INP_INTENSITY ));
					if (IsPortActive(pActInfo, INP_DISABLE))
					{
						pClientPlayer->GetPlayerHealthGameEffect().EnableExternalControl( false );
						if (gEnv->IsCutscenePlaying())
							pClientPlayer->GetPlayerHealthGameEffect().SetActive( false );
					}
				}
				break;
			}
		}
	}
开发者ID:Kufusonic,项目名称:Work-in-Progress-Sonic-Fangame,代码行数:29,代码来源:FlowPostFXNodes.cpp

示例5: ProcessEvent

    virtual void ProcessEvent( EFlowEvent event, SActivationInfo *pActInfo )
    {
        if (InputEntityIsLocalPlayer( pActInfo ))
        {
            switch (event)
            {
            case eFE_Initialize:
            {
                m_actInfo = *pActInfo;
                Register(true);
            }
            break;

            case eFE_Activate:
            {
                m_actInfo = *pActInfo;
                if (IsPortActive(pActInfo, EIP_Enable))
                {
                    Register(true);
                }
                if (IsPortActive(pActInfo, EIP_Disable))
                {
                    Register(false);
                }
            }
            break;
            }
        }
    }
开发者ID:souxiaosou,项目名称:FireNET,代码行数:29,代码来源:FlowNodesInput.cpp

示例6: ProcessEvent

	virtual void ProcessEvent(EFlowEvent event, SActivationInfo *pActInfo)
	{
		switch(event)
		{
		case eFE_Initialize:
			m_actInfo = *pActInfo;
			CMiniMapInfo::GetInstance()->UpdateLevelInfo();
			m_entityId = GetEntityId(pActInfo);
			break;

		case eFE_Activate:
			if(IsPortActive(pActInfo, eI_Trigger))
				TriggerPorts(pActInfo);

			if(IsPortActive(pActInfo, eI_Disable))
				UnRegisterEntity();

			if(IsPortActive(pActInfo, eI_Enable))
			{
				UnRegisterEntity();
				m_entityId = GetEntityId(pActInfo);
				RegisterEntity();
			}

			break;
		}
	}
开发者ID:Hellraiser666,项目名称:CryGame,代码行数:27,代码来源:FlowMinimapNodes.cpp

示例7: ProcessEvent

	virtual void ProcessEvent(EFlowEvent event, SActivationInfo *pActInfo)
	{
		CPersistantStats* pStats = g_pGame->GetPersistantStats();
		CRY_ASSERT(pStats != NULL);
		if (!pStats)
			return;

		switch (event)
		{
			case eFE_Activate:
			{	
				bool saveProfile = false;
				if (IsPortActive(pActInfo, EIP_FlagTutorialAsPlayed))
				{
					int val = pStats->GetStat( EIPS_TutorialAlreadyPlayed );
					pStats->SetClientStat( EIPS_TutorialAlreadyPlayed, val + 1 );
					saveProfile = true;
				}
				if (IsPortActive(pActInfo, EIP_FlagTutorialAsNOTPlayed))
				{
					pStats->SetClientStat( EIPS_TutorialAlreadyPlayed, 0 );
					saveProfile = true;
				}
				if (IsPortActive(pActInfo, EIP_GetFlagState))
				{
					int val = pStats->GetStat( EIPS_TutorialAlreadyPlayed );
					ActivateOutput( pActInfo, OUT_HasBeenPlayed, val!=0 );
				}
				if (saveProfile)
					g_pGame->GetProfileOptions()->SaveProfile(ePR_All);
			}
			break;
		}
	}
开发者ID:Xydrel,项目名称:Infected,代码行数:34,代码来源:AchievementNode.cpp

示例8: ProcessEvent

	void ProcessEvent( EFlowEvent event, SActivationInfo *pActInfo )
	{
		switch (event)
		{	
		case eFE_Initialize:
			{
				m_active = false;
				m_actInfo = *pActInfo;	// Keep a copy of the activation info to be able to use the output ports
#if CRY_PLATFORM_DURANGO				
				// Register listener
				if (gEnv->pSystem->GetIInput()->GetKinectInput())
				{
					gEnv->pSystem->GetIInput()->GetKinectInput()->RegisterKinectAudioListener(this,"CSpeechRecognitionListenerNode"); 
				}
#endif

			}
			break;
		case eFE_Activate:
			{				
				if(IsPortActive(pActInfo,eI_Enable))
				{
					m_active = true;
				}
				if(IsPortActive(pActInfo,eI_Disable))
				{
					m_active = false;
				}
			}
			break;
		}
	}
开发者ID:NightOwlsEntertainment,项目名称:PetBox_A_Journey_to_Conquer_Elementary_Algebra,代码行数:32,代码来源:FlowKinectNodesDurango.cpp

示例9: ProcessEvent

	void ProcessEvent( EFlowEvent event, SActivationInfo *pActInfo )
	{
		switch (event)
		{
		case eFE_Activate:
			if (IsPortActive(pActInfo,eIP_Get))
			{
				Vec3 v;
				gEnv->p3DEngine->GetGlobalParameter(E3DPARAM_SKY_MOONROTATION, v);
				ActivateOutput(pActInfo, eOP_Latitude, v.x);
				ActivateOutput(pActInfo, eOP_Longitude, v.y);
			}
			if (IsPortActive(pActInfo, eIP_Set))
			{
				Vec3 v(ZERO);
				v.x = GetPortFloat(pActInfo, eIP_Latitude);
				v.y = GetPortFloat(pActInfo, eIP_Longitude);
				gEnv->p3DEngine->SetGlobalParameter(E3DPARAM_SKY_MOONROTATION, v);
				ActivateOutput(pActInfo, eOP_Latitude, v.x);
				ActivateOutput(pActInfo, eOP_Longitude, v.y);
				bool forceUpdate = GetPortBool( pActInfo, eIP_ForceUpdate );
				ITimeOfDay* pTOD = gEnv->p3DEngine->GetTimeOfDay();
				if (forceUpdate && pTOD )
					pTOD->Update( true, true );
			}
		}
	}
开发者ID:NightOwlsEntertainment,项目名称:PetBox_A_Journey_to_Conquer_Elementary_Algebra,代码行数:27,代码来源:FlowEnvironmentNodes.cpp

示例10: ProcessEvent

	virtual void ProcessEvent( EFlowEvent event, SActivationInfo * pActInfo )
	{
		switch (event)
		{
		case eFE_Initialize:
			if (gEnv->IsEditor())
				m_bTriggered = false;
			break;
		case eFE_Activate:
			if (m_bTriggered == false)
			{
				for (int i=0; i<6; i++)
				{
					if (IsPortActive(pActInfo, i))
					{
						ActivateOutput(pActInfo, 0, GetPortAny(pActInfo, i));
						m_bTriggered = true;
						break;
					}
				}
			}
			if (IsPortActive(pActInfo, 6))
				m_bTriggered = false;
			break;
		}
	}
开发者ID:aronarts,项目名称:FireNET,代码行数:26,代码来源:FlowLogicNodes.cpp

示例11: ProcessEvent

	void ProcessEvent( EFlowEvent event, SActivationInfo *pActInfo )
	{
		if (event == eFE_Activate || event == eFE_Initialize)
		{
			if (IsPortActive(pActInfo, INP_ACTIVE))
			{
				bool active = GetPortBool(pActInfo, 0);
				if (active)
					m_pGF->GetIItemSystem()->RegisterListener(this);
				else
					m_pGF->GetIItemSystem()->UnregisterListener(this);
			}
			if (IsPortActive(pActInfo, INP_CHECK))
			{
				IActor* pActor = GetInputActor( pActInfo );
				if (pActor)
				{
					IInventory* pInventory = pActor->GetInventory();
					if (pInventory)
					{
						IEntity* pEntityItem = gEnv->pEntitySystem->GetEntity( pInventory->GetCurrentItem() );
						TriggerOutputs( pActInfo, pEntityItem );
					}
				}
			}
		}
	}
开发者ID:NightOwlsEntertainment,项目名称:PetBox_A_Journey_to_Conquer_Elementary_Algebra,代码行数:27,代码来源:FlowInventoryNodes.cpp

示例12: ProcessEvent

	virtual void ProcessEvent(EFlowEvent event, SActivationInfo *pActInfo)
	{
		switch (event)
		{
		case eFE_Activate:
			{
				IEntity* pEntity = pActInfo->pEntity;
				if(!pEntity)
					return;

				m_delayResult = GetPortBool(pActInfo, EIP_DelayResult);

				if(IsPortActive(pActInfo, EIP_Enable))
				{
					m_actInfo = *pActInfo;
					m_entityId = pEntity->GetId();
					SetEnabled(true);
				}
				else if(IsPortActive(pActInfo, EIP_Disable))
				{
					SetEnabled(false);
				}
				break;
			}
		}
	}
开发者ID:Xydrel,项目名称:Infected,代码行数:26,代码来源:TacticalScanNode.cpp

示例13: ProcessEvent

	virtual void ProcessEvent(EFlowEvent event, SActivationInfo *pActInfo)
	{
		switch(event)
		{
		case eFE_Activate:
			CGameRules *pGR = g_pGame->GetGameRules();

			if(!pGR)
				return;

			if(!pActInfo->pEntity)
				return;

			const bool bUseVapor = GetPortBool(pActInfo, EIP_Vapor);

			if(IsPortActive(pActInfo, EIP_Freeze))
			{
				pGR->FreezeEntity(pActInfo->pEntity->GetId(), true, bUseVapor, true);
				ActivateOutput(pActInfo, EOP_Frozen, true);
			}
			else if(IsPortActive(pActInfo, EIP_UnFreeze))
			{
				pGR->FreezeEntity(pActInfo->pEntity->GetId(), false, bUseVapor);
				ActivateOutput(pActInfo, EOP_UnFrozen, true);
			}

			break;
		}
	}
开发者ID:super-nova,项目名称:NovaRepo,代码行数:29,代码来源:FlowHitInfoNode.cpp

示例14: UpdateUIElement

void CFlashUIMCTemplateRemoveNode::ProcessEvent( EFlowEvent event,SActivationInfo* pActInfo )
{
	if (event == eFE_Initialize)
	{
		UpdateUIElement( GetPortString( pActInfo, eI_UIElement ), pActInfo );
	}
	else if (event == eFE_Activate)
	{
		if (IsPortActive( pActInfo, eI_UIElement ))
		{
			UpdateUIElement( GetPortString( pActInfo, eI_UIElement ), pActInfo );
		}

		if (!UpdateTmplDesc( GetPortString( pActInfo, eI_TemplateInstanceName ), pActInfo ))
			return;

		if (GetElement() && IsPortActive(pActInfo, eI_Remove))
		{
			const int instanceId = GetPortInt( pActInfo, eI_InstanceID );

			SPerInstanceCall1< const SUIMovieClipDesc* > caller;
			caller.Execute(GetElement(), instanceId, functor(*this, &CFlashUIMCTemplateRemoveNode::RemoveMoviclip), GetTmplDesc(true), false);

			ActivateOutput( pActInfo, eO_OnRemove, true );
		}
	}

}
开发者ID:joewan,项目名称:pycmake,代码行数:28,代码来源:FlashUIElementNodes.cpp

示例15: ProcessEvent

	virtual void ProcessEvent( EFlowEvent event, SActivationInfo *pActInfo )
	{
		switch (event)
		{
		case eFE_Activate:
			{
				IEntity* pEntity = pActInfo->pEntity;
				if (pEntity != 0)
				{
					ENanoMode nanoMode = NANOMODE_LAST;
					if (IsPortActive(pActInfo, EIP_Cloak))
						nanoMode = NANOMODE_CLOAK;
					else if (IsPortActive(pActInfo, EIP_Speed))
						nanoMode = NANOMODE_SPEED;
					else if (IsPortActive(pActInfo, EIP_Strength))
						nanoMode = NANOMODE_STRENGTH;
					else if (IsPortActive(pActInfo, EIP_Defense))
						nanoMode = NANOMODE_DEFENSE;
					if (nanoMode != NANOMODE_LAST)
					{
						const bool bAsian = GetPortBool(pActInfo, EIP_Asian);
						CNanoSuit::SNanoMaterial* pNanoMat = CNanoSuit::GetNanoMaterial(nanoMode, bAsian);
						if (pNanoMat)
						{
							CNanoSuit::AssignNanoMaterialToEntity(pEntity, pNanoMat);
							ActivateOutput(pActInfo, EOP_Done, true);
						}
					}
				}
			}
			break;
		}
	}
开发者ID:mrwonko,项目名称:CrysisVR,代码行数:33,代码来源:FlowNanoSuitNodes.cpp


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