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


C++ GetPortString函数代码示例

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


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

示例1: Execute

	virtual bool Execute(SActivationInfo *pActInfo)
	{
		bool bResult = false;

		SXmlDocument *doc;
		if (GDM->GetXmlDocument(pActInfo->pGraph, &doc) && doc->active)
		{
			const char* childName = GetPortString(pActInfo, EIP_Name);
			const int childIndex = GetPortInt(pActInfo, EIP_Index);
			const int childCount = doc->active->getChildCount();
			XmlNodeRef ref = NULL;
			for (int i = 0, realCount = 0; i < childCount; ++i)
			{
				ref = doc->active->getChild(i);
				if (ref && strcmp(ref->getTag(), childName) == 0)
				{
					if (++realCount >= childIndex)
					{
						doc->active->deleteChildAt(i);
						bResult = true;
						break;
					}
				}
			}
		}

		return bResult;
	}
开发者ID:aronarts,项目名称:FireNET,代码行数:28,代码来源:FlowXmlNavNodes.cpp

示例2: GetDynStartPort

void CFlashUIFunctionNode::ProcessEvent( EFlowEvent event,SActivationInfo* pActInfo )
{
	if (event == eFE_Activate && IsPortActive(pActInfo, eI_Call))
	{
		int          port = GetDynStartPort();
		SUIArguments args;
		for (TUIParams::const_iterator iter = m_funcDesc.InputParams.Params.begin(); iter != m_funcDesc.InputParams.Params.end(); ++iter)
		{
			GetDynInput( args, *iter, pActInfo, port++ );
		}

		TUIData   res;
		const int instanceId = GetPortInt( pActInfo, eI_InstanceID );

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

		SPerInstanceCall2< const SUIArguments &, TUIData & > caller;
		caller.Execute(m_pElement, instanceId, functor(*this, &CFlashUIFunctionNode::CallFunction), args, res);

		string out;
		res.GetValueWithConversion( out );
		ActivateOutput( pActInfo, eO_RetVal, out  );

		ActivateOutput( pActInfo, eO_OnCall, true );
	}
}
开发者ID:joewan,项目名称:pycmake,代码行数:27,代码来源:FlashUIElementNodes.cpp

示例3: WeaponAccessoryChanged

	virtual void WeaponAccessoryChanged(CWeapon* pWeapon, const char* accessory, bool bAdd)
	{
		const char* actWeaponName = pWeapon->GetEntity()->GetClass()->GetName();

		const string& weaponName = GetPortString(&m_actInfo, 0);
		if (weaponName.empty() == false && stricmp(actWeaponName, weaponName.c_str()) != 0)
			return;

		const string& itemName = GetPortString(&m_actInfo, 1);
		if (itemName.empty() == false && stricmp(accessory, itemName.c_str()) != 0)
			return;

		string name (actWeaponName);
		string accName (accessory);
		ActivateOutput(&m_actInfo, 0, name);
		ActivateOutput(&m_actInfo, bAdd ? 1 : 2, accName);
	}
开发者ID:RenEvo,项目名称:dead6,代码行数:17,代码来源:WeaponNodes.cpp

示例4: ProcessEvent

	void ProcessEvent(EFlowEvent event, SActivationInfo* pActInfo)
	{
#if !defined(_RELEASE)
		if (event == eFE_Initialize && IsPortActive(pActInfo, eIP_Draw))
		{
			m_waitTime = 0.0f;
			pActInfo->pGraph->SetRegularlyUpdated(pActInfo->myID, false);
		}
		else if (event == eFE_Activate && IsPortActive(pActInfo, eIP_Draw))
		{
			IEntity* pEntity = pActInfo->pEntity;
			if (pEntity)
			{
				IPersistantDebug* pPersistentDebug = CCryAction::GetCryAction()->GetIPersistantDebug();
				if (pPersistentDebug)
				{
					SEntityTagParams params;
					params.entity = pEntity->GetId();
					params.text = GetPortString(pActInfo, eIP_Message);
					params.size = GetPortFloat(pActInfo, eIP_FontSize);
					params.color = ColorF(GetPortVec3(pActInfo, eIP_Color), 1.0f);
					params.visibleTime = GetPortFloat(pActInfo, eIP_Time);
					params.fadeTime = GetPortFloat(pActInfo, eIP_FadeTime);
					params.viewDistance = GetPortFloat(pActInfo, eIP_ViewDistance);
					params.staticId = GetPortString(pActInfo, eIP_StaticID);
					params.column = GetPortInt(pActInfo, eIP_Column);
					params.tagContext = "FG_DrawEntityTagAdvanced";

					pPersistentDebug->AddEntityTag(params);

					m_waitTime = gEnv->pTimer->GetFrameStartTime() + (params.fadeTime + params.visibleTime);
					pActInfo->pGraph->SetRegularlyUpdated(pActInfo->myID, true);
				}
			}
		}
		else if (event == eFE_Update)
		{
			if (m_waitTime < gEnv->pTimer->GetFrameStartTime())
			{
				m_waitTime.SetSeconds(0.0f);
				pActInfo->pGraph->SetRegularlyUpdated(pActInfo->myID, false);
				ActivateOutput(pActInfo, eOP_Done, GetPortAny(pActInfo, eIP_Draw));
			}
		}
#endif
	}
开发者ID:NightOwlsEntertainment,项目名称:PetBox_A_Journey_to_Conquer_Elementary_Algebra,代码行数:46,代码来源:FlowDebugNodes.cpp

示例5: GetRtpcID

	void GetRtpcID(SActivationInfo* const pActInfo)  
	{
		string const& rRtpcName = GetPortString(pActInfo, eIn_RtpcName);
		if (!rRtpcName.empty())
		{
			gEnv->pAudioSystem->GetAudioRtpcID(rRtpcName.c_str(), m_nRtpcID);
		}
	}
开发者ID:aronarts,项目名称:FireNET,代码行数:8,代码来源:FlowAudioRtpcNode.cpp

示例6: UpdateObjectDesc

void CFlashUIVariableBaseNode::ProcessEvent( EFlowEvent event, SActivationInfo* pActInfo )
{
	if (event == eFE_Initialize)
	{
		UpdateObjectDesc( GetPortString( pActInfo, GetInputPort(eI_UIVariable)), pActInfo, m_isTemplate );
	}
	else if (event == eFE_Activate)
	{
		if (IsPortActive( pActInfo, GetInputPort(eI_UIVariable)))
		{
			UpdateObjectDesc( GetPortString( pActInfo, GetInputPort(eI_UIVariable)), pActInfo, m_isTemplate );
		}

		if (IsTemplate() && !UpdateTmplDesc( GetPortString( pActInfo, GetInputPort(eI_TemplateInstanceName)), pActInfo ))
			return;

		const int instanceId = GetPortInt( pActInfo, GetInputPort(eI_InstanceID));
		if (IsPortActive ( pActInfo, GetInputPort(eI_Set)))
		{
			const TFlowInputData &data = GetPortAny( pActInfo, GetInputPort(eI_Value));
			TUIData               value;
			ConvertToUIData(data, value, pActInfo);

			SPerInstanceCall1< const TUIData & > caller;
			caller.Execute( GetElement(), instanceId, functor(*this, &CFlashUIVariableBaseNode::SetVariable), value );

			ActivateOutput( pActInfo, eO_OnSet, true );
		}
		if (IsPortActive( pActInfo, GetInputPort(eI_Get)))
		{
			TUIData out;

			SPerInstanceCall1< TUIData & > caller;
			if (!caller.Execute( GetElement(), instanceId, functor(*this, &CFlashUIVariableBaseNode::GetVariable), out, false ))
			{
				UIACTION_WARNING( "FG: UIElement \"%s\" called get Variable for multiple instances! (passed instanceId %i), referenced at node \"%s\"", GetElement()->GetName(),instanceId, pActInfo->pGraph->GetNodeTypeName( pActInfo->myID ));
			}

			string res;
			out.GetValueWithConversion( res );
			ActivateOutput( pActInfo, eO_Value, res );
		}
	}

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

示例7: IsPortActive

void CFlowNode_SimulateInput::ProcessEvent(EFlowEvent event, SActivationInfo *pActInfo)
{
	if(event == eFE_Activate)
	{
		bool isPressPort = IsPortActive(pActInfo, eInputPorts_Press);
		bool isReleasePort = IsPortActive(pActInfo, eInputPorts_Release);
		bool isHoldPort = IsPortActive(pActInfo, eInputPorts_Hold);

		bool triggerResponse = false;
		int playerInputEvent;
		int nodeOutput;

		if(isPressPort)
		{
			triggerResponse = true;
			playerInputEvent = eAAM_OnPress;
			nodeOutput = eOutputPort_Pressed;
		}
		else if(isHoldPort)
		{
			triggerResponse = true;
			playerInputEvent = eAAM_OnHold;
			nodeOutput = eOutputPort_Held;
		}
		else if(isReleasePort)
		{
			triggerResponse = true;
			playerInputEvent = eAAM_OnRelease;
			nodeOutput = eOutputPort_Released;
		}

		if(triggerResponse)
		{
			CActor *pClientActor = static_cast<CActor *>(g_pGame->GetIGameFramework()->GetClientActor());

			if(pClientActor)
			{
				if(pClientActor->GetActorClass() == CPlayer::GetActorClassType())
				{
					CPlayer *pClientPlayer = static_cast<CPlayer *>(pClientActor);
					const char *action = GetPortString(pActInfo, eInputPorts_Action).c_str();
					const float inputValue = GetPortFloat(pActInfo, eInputPorts_Value);

					IPlayerInput *pPlayerInput = pClientPlayer->GetPlayerInput();

					if(pPlayerInput)
					{
						CODECHECKPOINT(SimulateInput_ProcessEvent_SendAction);
						pPlayerInput->OnAction(action, playerInputEvent, isPressPort ? clamp(inputValue, 0.0f, 1.0f) : 0.0f);
					}
				}
			}

			ActivateOutput(pActInfo, nodeOutput, true);
		}
	}
}
开发者ID:super-nova,项目名称:NovaRepo,代码行数:57,代码来源:FeatureTestNode.cpp

示例8: ProcessEvent

	virtual void ProcessEvent( EFlowEvent event, SActivationInfo* pActInfo)
	{
		if (!m_pDialogMan)
			return;

		switch (event)
		{
		case eFE_Initialize:
			if (m_bDisplayed)
				m_pDialogMan->CancelDialog(m_id);
			m_ActInfo = *pActInfo;
			break;
		case eFE_Activate:
			if (IsPortActive(pActInfo, eI_Display))
			{
				if (m_bDisplayed)
				{
					gEnv->pLog->LogWarning("FG: Dialog is already displayed!");
					ActivateOutput(pActInfo, eO_OnShow, true);
					return;
				}
				EDialogType type = (EDialogType) GetPortInt(pActInfo, eI_Type);
				const string title = GetPortString(pActInfo, eI_Title);
				const string message = GetPortString(pActInfo, eI_Message);
				const string param = GetPortString(pActInfo, eI_Param);
				m_id = m_pDialogMan->DisplayDialog(type, title.c_str(), message.c_str(), param.c_str(), this);
				m_bDisplayed = true;
				ActivateOutput(pActInfo, eO_OnShow, true);
			}
			if (IsPortActive(pActInfo, eI_Cancel))
			{
				if (!m_bDisplayed)
				{
					gEnv->pLog->LogWarning("FG: Dialog is not displayed!");
					ActivateOutput(&m_ActInfo, eO_Param, string(""));
					ActivateOutput(&m_ActInfo, eO_Result, 2);
					return;
				}
				m_pDialogMan->CancelDialog(m_id);
			}
			break;
		}
	}
开发者ID:Orav,项目名称:CryMono,代码行数:43,代码来源:UIDialogs.cpp

示例9: ProcessEvent

	virtual void ProcessEvent( EFlowEvent event, SActivationInfo *pActInfo )
	{
		switch(event)
		{
		case eFE_Activate:
			{
				if (IsPortActive(pActInfo, eIP_Get))
				{
					IPlayerProfile* pProfile = NULL;
					if (IPlayerProfileManager *pProfileMan = gEnv->pGame->GetIGameFramework()->GetIPlayerProfileManager())
					{
						const char* user = pProfileMan->GetCurrentUser();
						pProfile = pProfileMan->GetCurrentProfile(user);
						TFlowInputData data;
						if (!pProfile || pProfile->GetAttribute(GetPortString(pActInfo, eIP_Name), data))
						{
							ActivateOutput(pActInfo, eOP_Value, data);
						}
						else
						{
							ActivateOutput(pActInfo, eOP_Error, 1);
						}
					}
				}

				if (IsPortActive(pActInfo, eIP_Set))
				{
					IPlayerProfile* pProfile = NULL;
					if (IPlayerProfileManager *pProfileMan = gEnv->pGame->GetIGameFramework()->GetIPlayerProfileManager())
					{
						const char *user = pProfileMan->GetCurrentUser();
						pProfile = pProfileMan->GetCurrentProfile( user );
						if(!pProfile || !pProfile->SetAttribute(GetPortString(pActInfo, eIP_Name), GetPortAny(pActInfo, eIP_Set)))
						{
							ActivateOutput(pActInfo, eOP_Error, 1);
						}
					}
				}
			}
			break;
		}
	}
开发者ID:aronarts,项目名称:FireNET,代码行数:42,代码来源:FlowOnlineStatsNodes.cpp

示例10: switch

void CFlowAddModelToPostRender::ProcessEvent( EFlowEvent event, SActivationInfo *pActInfo )
{
	switch (event)
	{
	case eFE_Initialize:
		break;
	case eFE_Activate:
		if (IsPortActive(pActInfo, IN_ADD))
		{
			INDENT_LOG_DURING_SCOPE();
			//Create scene
			CMenuRender3DModelMgr *renderModels = CMenuRender3DModelMgr::GetInstance();
			
			if (renderModels)
			{
				//Add model with animation if needed
				const float playSpeed = GetPortFloat(pActInfo, IN_ANIM_SPEED);
				const char * usePlayerModelName = GetPortString(pActInfo, IN_MODEL);
				const char * useAnimation = GetPortString(pActInfo, IN_ANIM);

				CMenuRender3DModelMgr::SModelParams params;
				params.pFilename = usePlayerModelName;
				params.posOffset = GetPortVec3(pActInfo, IN_ENTITYPOS);
				params.rot = Ang3(GetPortVec3(pActInfo, IN_ENTITYROT));
				params.continuousRot = Ang3(GetPortVec3(pActInfo, IN_ENTITYCONTROT));
				params.scale = GetPortFloat(pActInfo, IN_SCALE);
				params.pName = "char";
				params.screenRect[0] = GetPortVec3(pActInfo, IN_SCREENUV).x;
				params.screenRect[1] = GetPortVec3(pActInfo, IN_SCREENUV).y;
				params.screenRect[2] = GetPortVec3(pActInfo, IN_SCREENU2V2).x;
				params.screenRect[3] = GetPortVec3(pActInfo, IN_SCREENU2V2).y;

				if(strcmp(usePlayerModelName, "") != 0)
					characterModelIndex = renderModels->AddModel(params);

				if(strcmp(useAnimation, "") != 0)
					renderModels->UpdateAnim(characterModelIndex, useAnimation, playSpeed);
			}
		}
		break;
	}
}
开发者ID:danielasun,项目名称:dbho-GameSDK,代码行数:42,代码来源:ModelToHudFlowNodes.cpp

示例11: ProcessEvent

	void ProcessEvent( EFlowEvent event, SActivationInfo *pActInfo )
	{
		if (event == eFE_Activate && IsPortActive(pActInfo, EIP_Trigger))
		{
			IActor* pActor = GetInputActor( pActInfo );
			if (!pActor)
				return;

			IInventory *pInventory = pActor->GetInventory();
			if (!pInventory)
				return;

			const bool& addPack = GetPortBool(pActInfo, EIP_AddToggle);
			const string& packName = GetPortString(pActInfo, EIP_EquipmentPack);
			const bool& selectPrimary = GetPortBool(pActInfo, EIP_SelectPrimary);

			if (pActor->IsPlayer())
				pInventory->RMIReqToServer_AddEquipmentPack( packName.c_str(), addPack, selectPrimary );
			else
			{
				if (gEnv->bServer)
					CCryAction::GetCryAction()->GetIItemSystem()->GetIEquipmentManager()->GiveEquipmentPack( pActor, packName.c_str(), addPack, selectPrimary );
			}
				
			// TODO: instant output activation, with delayed effective change in the inventory, it potentially could cause problems in rare situations
			ActivateOutput(pActInfo, EOP_Done, true);
		}
		else if (event == eFE_PrecacheResources)
		{
			const string& packName = GetPortString(pActInfo, 1);

			if (!packName.empty())
			{
				IGameRules* pGameRules = CCryAction::GetCryAction()->GetIGameRulesSystem()->GetCurrentGameRules();
				CRY_ASSERT_MESSAGE(pGameRules != NULL, "No game rules active, can not precache resources");
				if (pGameRules)
				{
					pGameRules->PrecacheLevelResource(packName.c_str(), eGameResourceType_Loadout);
				}
			}
		}
	}
开发者ID:NightOwlsEntertainment,项目名称:PetBox_A_Journey_to_Conquer_Elementary_Algebra,代码行数:42,代码来源:FlowInventoryNodes.cpp

示例12: ProcessEvent

	virtual void ProcessEvent(EFlowEvent event, SActivationInfo *pActInfo)
	{
		m_actInfo = *pActInfo;
		switch (event)
		{
			case eFE_Activate:
			{
				if (GetPortBool(pActInfo, EIP_Enabled)) {
					if (IsPortActive(pActInfo, EIP_Send)) {
						// try to open port socket
						port = GetPortInt(pActInfo, EIP_Port);
						address = GetPortString(pActInfo, EIP_Address);
						string message = GetPortString(pActInfo, EIP_Message);
						SendMessage(port, address, message);
					}
				}
			}
			break;
		}
	}
开发者ID:neonascent,项目名称:FGPS---UDP-listener,代码行数:20,代码来源:FlowUdpNodeMulticastSender.cpp

示例13: OnMessage

	// INetMsgListener
	virtual void OnMessage(const SNetMsgData &data) override
	{
		// Notify if the expected message has arrived
		const string &key = GetPortString(&m_actInfo,IN_MSG);
		if (data.key == key)
		{
			NET_MSG_DISPATCHER_LOG("CFlowNode_MsgReceiver: %s Listener received message [%s->%s]-[%s/%s]", CNetMessageDistpatcher::DbgTranslateLocationToString(), data.DbgTranslateSourceToString(),  data.DbgTranslateTargetToString(), key.c_str(), data.value.c_str());
			ActivateOutput(&m_actInfo, OUT_RECEIVED, true);
			ActivateOutput(&m_actInfo, OUT_VALUE, data.value);
		}
	}
开发者ID:joewan,项目名称:pycmake,代码行数:12,代码来源:FlowNetMsgNodes.cpp

示例14: GetSwitchStateID

	void GetSwitchStateID(SActivationInfo* const pActInfo, uint32 const nStateInputIdx)
	{
		string const& rStateName = GetPortString(pActInfo, nStateInputIdx);
		if (!rStateName.empty() && (m_nSwitchID != INVALID_AUDIO_CONTROL_ID))
		{
			gEnv->pAudioSystem->GetAudioSwitchStateID(
				m_nSwitchID,
				rStateName.c_str(),
				m_aSwitchStates[nStateInputIdx-eIn_SwitchStateNameFirst]);
		}
	}
开发者ID:NightOwlsEntertainment,项目名称:PetBox_A_Journey_to_Conquer_Elementary_Algebra,代码行数:11,代码来源:FlowAudioSwitchNode.cpp

示例15: GetPortString

void CGeomEntity::OnFlowgraphActivation(EntityId entityId, IFlowNode::SActivationInfo* pActInfo, const class CFlowGameEntityNode* pNode)
{
	if (CGeomEntity* pGeomEntity = QueryExtension(entityId))
	{
		if (IsPortActive(pActInfo, eInputPorts_LoadGeometry))
		{
			pGeomEntity->GetEntity()->LoadGeometry(0, GetPortString(pActInfo, eInputPorts_LoadGeometry));
			ActivateOutputPort(entityId, eOutputPorts_Done, TFlowInputData(true));
		}
	}
}
开发者ID:NightOwlsEntertainment,项目名称:PetBox_A_Journey_to_Conquer_Elementary_Algebra,代码行数:11,代码来源:GeomEntity.cpp


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