您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ GetPortString函数代码示例

51自学网 2021-06-01 21:13:13
  C++
这篇教程C++ GetPortString函数代码示例写得很实用,希望能帮到您。

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

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


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例16: UIACTION_WARNING

void CFlashUIVariableBaseNode::ConvertToUIData( const TFlowInputData &in, TUIData &out, SActivationInfo* pActInfo){	if (!GetObjectDesc())	{		UIACTION_WARNING( "FG: No valid Variable /"%s/"! (Referenced at node /"%s/")", GetPortString(pActInfo, GetInputPort(eI_UIVariable)).c_str(), pActInfo->pGraph->GetNodeTypeName( pActInfo->myID ));		return;	}	bool        ok      = false;	const char* vartype = "any";	switch (GetObjectDesc()->eType)	{	case SUIParameterDesc::eUIPT_Bool:	{		bool value;		ok      = in.GetValueWithConversion(value);		out     = TUIData(value);		vartype = "bool";	}	break;	case SUIParameterDesc::eUIPT_Int:	{		int value;		ok      = in.GetValueWithConversion(value);		out     = TUIData(value);		vartype = "int";	}	break;	case SUIParameterDesc::eUIPT_Float:	{		float value;		ok      = in.GetValueWithConversion(value);		out     = TUIData(value);		vartype = "float";	}	break;	case SUIParameterDesc::eUIPT_String: // fall through, just change the type desc		vartype = "string";	case SUIParameterDesc::eUIPT_Any:	default:	{		string value;		ok  = in.GetValueWithConversion(value);		out = TUIData(value);	}	break;	}	if (!ok)	{		UIACTION_WARNING( "FG: UIElement /"%s/" Variable /"%s/" expected type /"%s/" given value was not compatible! (Referenced at node /"%s/")", GetElement()->GetName(),GetObjectDesc()->sDisplayName, vartype, pActInfo->pGraph->GetNodeTypeName( pActInfo->myID ));	}}
开发者ID:joewan,项目名称:pycmake,代码行数:53,


示例17: ProcessEvent

  virtual void ProcessEvent( EFlowEvent event, SActivationInfo *pActInfo )  {    if (event != eFE_Activate)      return;		I3DEngine* pEngine = gEnv->p3DEngine;		const string& message = GetPortString(pActInfo, EIP_ParamName);		const float& fParamFloat = GetPortFloat(pActInfo, EIP_ParamFloat);		pEngine->SetPostEffectParam(message, fParamFloat);  }
开发者ID:PiratesAhoy,项目名称:HeartsOfOak-Core,代码行数:12,


示例18: OnGrammarChange

	virtual void OnGrammarChange(const char * grammarName, eGrammaChange change)	{		const string & myGrammarName = GetPortString(&m_actInfo, eI_GrammarName);		if (myGrammarName == grammarName)		{			EOutputs outputPort = change == eGC_Enabled ? eO_Enabled : 														change == eGC_Disabled ? eO_Disabled : eO_NotLoaded;			ActivateOutput(&m_actInfo, outputPort, true );		}	}
开发者ID:NightOwlsEntertainment,项目名称:PetBox_A_Journey_to_Conquer_Elementary_Algebra,代码行数:12,


示例19: UpdateUIElement

void CFlashUILayerNode::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 );        }        const int instanceId =  GetPortInt( pActInfo, eI_InstanceID );        if ( IsPortActive( pActInfo, eI_Get ) )        {            int layer = 0;            SPerInstanceCall1< int& > caller;            if ( !caller.Execute( GetElement(), instanceId, functor(*this, &CFlashUILayerNode::GetLayer), layer, false) )            {                UIACTION_WARNING( "FG: UIElement /"%s/" called get layer 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_Layer, layer );            ActivateOutput( pActInfo, eO_OnGet, true );        }        if ( IsPortActive( pActInfo, eI_Set ) )        {            const int layer = GetPortInt( pActInfo, eI_Layer );            SPerInstanceCall1< int > caller;            caller.Execute( GetElement(), instanceId, functor(*this, &CFlashUILayerNode::SetLayer), layer );            ActivateOutput( pActInfo, eO_OnSet, true );        }    }}
开发者ID:souxiaosou,项目名称:FireNET,代码行数:40,


示例20: ProcessEvent

    virtual void ProcessEvent( EFlowEvent event,SActivationInfo *pActInfo )    {        switch (event)        {        case eFE_Activate:        {            if (!m_file)            {                const string& filename = GetPortString(pActInfo, 0);                if (filename.empty())                    return;                if (!(m_file = fopen(filename.c_str(), "w+")))                    return;                string name;                name.reserve(256);                for (int i = 0; i < 10; i++)                    if (GetPortString(pActInfo, 1+i*2).length())                        name += GetPortString(pActInfo, 1+i*2)+",";                fputs(name.c_str(), m_file);                fputs("/n", m_file);            }            string value;            value.reserve(256);            for (int i = 0; i < 10; i++)                if (GetPortString(pActInfo, 1+i*2).length())                    value += GetPortString(pActInfo, 2+i*2)+",";            fputs(value.c_str(), m_file);            fputs("/n", m_file);            fflush(m_file);        }        break;        };    };
开发者ID:souxiaosou,项目名称:FireNET,代码行数:40,


示例21: ProcessEvent

	virtual void ProcessEvent( EFlowEvent event, SActivationInfo *pActInfo )	{		if (event == eFE_Activate)		{			const bool isSet = (IsPortActive(pActInfo, SET));			if (isSet)			{				const string& stringToExecute = GetPortString(pActInfo, STRING);				const bool nextFrame = GetPortBool(pActInfo, NEXT_FRAME);				gEnv->pConsole->ExecuteString(stringToExecute, true, nextFrame);;			}		}	}
开发者ID:aronarts,项目名称:FireNET,代码行数:13,


示例22: GetPortString

void CFlowNode_ColorGradient::ProcessEvent(EFlowEvent event, SActivationInfo* activationInformation){	//Preload texture	if(event==IFlowNode::eFE_PrecacheResources && m_pTexture==NULL)	{		const string texturePath = GetPortString(activationInformation, eInputPorts_TexturePath);		const uint32 COLORCHART_TEXFLAGS = FT_NOMIPS |  FT_DONT_STREAM | FT_DONT_RESIZE | FT_STATE_CLAMP;		m_pTexture = gEnv->pRenderer->EF_LoadTexture(texturePath.c_str(), COLORCHART_TEXFLAGS);				//CryLogAlways("CFlowNode_ColorGradient 0x%p: Precache texture %s", this, texturePath.c_str());	}	if (event==IFlowNode::eFE_Activate && IsPortActive(activationInformation, eIP_Trigger))	{		const string texturePath = GetPortString(activationInformation, eInputPorts_TexturePath);		const float timeToFade = GetPortFloat(activationInformation, eInputPorts_TransitionTime);		g_pGame->GetColorGradientManager().TriggerFadingColorGradient(texturePath, timeToFade);	}}
开发者ID:danielasun,项目名称:dbho-GameSDK,代码行数:22,


示例23: IsClassAllowed

	bool IsClassAllowed(const char* entClass)	{		const char* classFilter = GetPortString(&m_pActInfo, eIP_Class).c_str();		if(strcmp(classFilter, "AllClasses") == 0 || strcmp(classFilter, entClass) == 0)		{			return true;		}		else if(strcmp(classFilter, "CustomClasses") == 0)		{			string customClasses = GetPortString(&m_pActInfo, eIP_CustomClass);			std::vector<string> CustomClassList;			splitStringList(&CustomClassList, customClasses.c_str(), ',');			for (unsigned int i = 0; i < CustomClassList.size(); i++)			{				if(strcmp(entClass, CustomClassList[i]) == 0)					return true;			}					}		return false;	}
开发者ID:aronarts,项目名称:FireNET,代码行数:22,


示例24: args

void CFlashUIFromArrayExNode::ProcessEvent( EFlowEvent event,SActivationInfo* pActInfo ){	if (event == eFE_Activate && IsPortActive( pActInfo, eI_Get ))	{		SUIArguments args( GetPortString( pActInfo, eI_Array ).c_str());		int          index = GetPortInt( pActInfo, eI_Index );		string       arg;		if (args.GetArg( index, arg ))		{			ActivateOutput( pActInfo, eO_Val, arg );		}	}}
开发者ID:joewan,项目名称:pycmake,代码行数:13,


示例25: OnVoiceCommand

	virtual void OnVoiceCommand(const char * voiceCommand)	{		if (m_active)		{			const string & command = GetPortString(&m_actInfo, eI_Command);			if (command == voiceCommand)			{				// Note: the voieCommand will be the TAG field of the command input in the GRXML file				// This is so to make sure that the recognition is independent from the language				ActivateOutput(&m_actInfo, eO_Active, true );			}		}	}
开发者ID:NightOwlsEntertainment,项目名称:PetBox_A_Journey_to_Conquer_Elementary_Algebra,代码行数:13,


示例26: OnExplosion

	virtual void OnExplosion(const ExplosionInfo &explosionInfo)	{		if(GetPortBool(&m_actInfo, EIP_Enable) == false)			return;		EntityId shooter = GetPortEntityId(&m_actInfo, EIP_ShooterId);		if(shooter != 0 && shooter != explosionInfo.shooterId)			return;		EntityId impactTarget = GetPortEntityId(&m_actInfo, EIP_ImpactTargetId);		if(impactTarget != 0 && explosionInfo.impact && impactTarget != explosionInfo.impact_targetId)			return;		IEntitySystem *pEntitySys = gEnv->pEntitySystem;		IEntity *pTempEntity = pEntitySys->GetEntity(explosionInfo.weaponId);		// check ammo match		const string &ammo = GetPortString(&m_actInfo, EIP_Ammo);		if(ammo.empty() == false)		{			if(pTempEntity == 0 || ammo.compare(pTempEntity->GetClass()->GetName()) != 0)				return;		}		string ammoClass = pTempEntity ? pTempEntity->GetClass()->GetName() : "";		ActivateOutput(&m_actInfo, EOP_ShooterId, explosionInfo.shooterId);		ActivateOutput(&m_actInfo, EOP_Ammo, ammoClass);		ActivateOutput(&m_actInfo, EOP_Pos, explosionInfo.pos);		ActivateOutput(&m_actInfo, EOP_Dir, explosionInfo.dir);		ActivateOutput(&m_actInfo, EOP_Radius, explosionInfo.radius);		ActivateOutput(&m_actInfo, EOP_Damage, explosionInfo.damage);		ActivateOutput(&m_actInfo, EOP_Pressure, explosionInfo.pressure);		ActivateOutput(&m_actInfo, EOP_HoleSize, explosionInfo.hole_size);		const char *hitType = 0;		if(CGameRules *pGR = g_pGame->GetGameRules())			hitType = pGR->GetHitType(explosionInfo.type);		hitType = hitType ? hitType : "";		ActivateOutput(&m_actInfo, EOP_Type, string(hitType));		if(explosionInfo.impact)		{			ActivateOutput(&m_actInfo, EOP_ImpactTargetId, explosionInfo.impact_targetId);			ActivateOutput(&m_actInfo, EOP_ImpactNormal, explosionInfo.impact_normal);			ActivateOutput(&m_actInfo, EOP_ImpactVelocity, explosionInfo.impact_velocity);		}	}
开发者ID:super-nova,项目名称:NovaRepo,代码行数:51,


示例27: GetInputActor

void CFlashUIGetCompatibleAccessoriesNode ::ProcessEvent( EFlowEvent event, SActivationInfo *pActInfo ){	if(event == eFE_Activate && IsPortActive(pActInfo, 0))	{		string accessories = "";		IActor* pActor = GetInputActor( pActInfo );		if(pActor)		{			IInventory* pInventory = pActor->GetInventory();			if(pInventory)			{				//Get the item ID via the Input string				const string weapon_name = GetPortString(pActInfo, eI_Weapon);				IEntityClassRegistry *pRegistery = gEnv->pEntitySystem->GetClassRegistry();				EntityId item = pInventory->GetItemByClass(pRegistery->FindClass(weapon_name));				//Fetch the actual weapon via the ID				IEntity* pEntity = gEnv->pEntitySystem->GetEntity(item);				if(pEntity)				{					CGameObject * pGameObject = (CGameObject*)pEntity->GetProxy(ENTITY_PROXY_USER);					const char* ext = pGameObject->GetEntity()->GetClass()->GetName();					CWeapon* pWeapon = (CWeapon*)pGameObject->QueryExtension(pGameObject->GetEntity()->GetClass()->GetName());					//If the weapon exists, ask for all compatible accessories					if(pWeapon)					{						//All compatible accessories for this weapon						const DynArray<string> pCompatibleAccessoriesVec = pWeapon->GetCompatibleAccessories();						bool first = true;						DynArray<string>::const_iterator it;						for (it = pCompatibleAccessoriesVec.begin(); it != pCompatibleAccessoriesVec.end(); it++)						{							if (!first)								accessories.append(",");							accessories.append((*it));							first = false;						}					}				}			}		}		//return, if 'accessories' is empty, it has no compatible attachments, or the weapon/inventory was invalid		ActivateOutput(pActInfo, eO_OnCall, true);		ActivateOutput(pActInfo, eO_Args, accessories);	}}
开发者ID:PiratesAhoy,项目名称:HeartsOfOak-Core,代码行数:51,



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


C++ GetPos函数代码示例
C++ GetPortInt函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。