本文整理汇总了C++中GetPortInt函数的典型用法代码示例。如果您正苦于以下问题:C++ GetPortInt函数的具体用法?C++ GetPortInt怎么用?C++ GetPortInt使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetPortInt函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ProcessEvent
virtual void ProcessEvent( EFlowEvent event, SActivationInfo *pActInfo )
{
switch(event)
{
case eFE_Update:
{
}
break;
case eFE_Activate:
{
if(IsPortActive(pActInfo, EIP_Get))
{
gEnv->pGame->GetIGameFramework()->RegisterListener(this, "FlowMouseEntitiesInBox", FRAMEWORKLISTENERPRIORITY_DEFAULT);
m_get = true;
m_actInfo = *pActInfo;
m_screenX = GetPortInt(pActInfo, EIP_ScreenX);
m_screenY = GetPortInt(pActInfo, EIP_ScreenY);
m_screenX2 = GetPortInt(pActInfo, EIP_ScreenX2);
m_screenY2 = GetPortInt(pActInfo, EIP_ScreenY2);
}
break;
}
}
}
开发者ID:NightOwlsEntertainment,项目名称:PetBox_A_Journey_to_Conquer_Elementary_Algebra,代码行数:26,代码来源:FlowMouseInfo.cpp
示例2: switch
void CFlashUIEventNode::ProcessEvent( EFlowEvent event,SActivationInfo* pActInfo )
{
switch (event)
{
case eFE_Initialize:
{
pActInfo->pGraph->SetRegularlyUpdated(pActInfo->myID, true);
m_events.clear();
m_events.init( pActInfo->pGraph );
ClearListener();
m_iCurrInstanceId = GetPortInt(pActInfo, eI_InstanceID);
if (m_iCurrInstanceId < -1)
m_iCurrInstanceId = -1;
SPerInstanceCall0 caller;
caller.Execute(m_pElement, m_iCurrInstanceId, functor(*this, &CFlashUIEventNode::RegisterAsListener));
}
break;
case eFE_Activate:
if (IsPortActive( pActInfo, eI_InstanceID ))
{
m_iCurrInstanceId = GetPortInt(pActInfo, eI_InstanceID);
if (m_iCurrInstanceId < -1)
m_iCurrInstanceId = -1;
ClearListener();
SPerInstanceCall0 caller;
caller.Execute(m_pElement, m_iCurrInstanceId, functor(*this, &CFlashUIEventNode::RegisterAsListener));
}
break;
case eFE_Update:
FlushNextEvent( pActInfo );
break;
}
}
示例3: OnInputEvent
// ~IInputEventListener
virtual bool OnInputEvent( const SInputEvent &event )
{
if (true == m_bActive)
{
#if defined(ORBIS) // FIXME: Using PS3 inputs for ORBIS
int nThisKey = event.keyId;
int nKey = -1;
int nInput = GetPortInt(&m_actInfo, EIP_Key);
int tableSize = sizeof(PS3KeyTable)/sizeof(PS3KeyTable[0]);
if ( nInput>=0 && nInput<tableSize )
nKey = PS3KeyTable[nInput];
#else
// Translate key, check value
const int nThisKey = TranslateKey(event.keyId);
const int nKey = GetPortInt(&m_actInfo, EIP_Key);
#endif
if (nKey == nThisKey)
{
// Return based on state
if (eIS_Pressed == event.state)
ActivateOutput(&m_actInfo, EOP_Pressed, true);
else if (eIS_Released == event.state)
ActivateOutput(&m_actInfo, EOP_Released, true);
}
}
// Let other listeners handle it
return false;
}
示例4: Serialize
virtual void Serialize(SActivationInfo *pActInfo, TSerialize ser)
{
ser.BeginGroup("Local");
ser.Value("Active", m_bActive);
if (m_bActive)
{
ser.Value("position", m_position);
ser.Value("destination", m_destination);
ser.Value("startPos", m_startPos);
ser.Value("lastFrameTime", m_lastFrameTime);
ser.Value("topSpeed", m_topSpeed);
ser.Value("easeInDistance", m_easeInDistance);
ser.Value("easeOutDistance", m_easeOutDistance);
ser.Value("stopping", m_stopping);
ser.Value("startTime", m_startTime);
ser.Value("bForceFinishAsTooNear", m_bForceFinishAsTooNear);
}
ser.EndGroup();
if (ser.IsReading())
{
m_coorSys = (ECoordSys)GetPortInt( pActInfo, IN_COORDSYS );
m_valueType = (EValueType)GetPortInt(pActInfo, IN_VALUETYPE);
}
}
示例5: ReadCurrentInputParams
//----------------------------------------------------------------------
void ReadCurrentInputParams( SActivationInfo* pActInfo, SInputParams &inputParams )
{
int presetIndex = GetPortInt( pActInfo, EIP_Preset );
if (presetIndex > 0 && presetIndex <= NUM_PRESETS)
{
inputParams = m_Presets[presetIndex - 1];
inputParams.angle = Ang3(DEG2RAD(m_Presets[presetIndex - 1].angle));
}
else
{
inputParams.groundOnly = GetPortBool(pActInfo, EIP_GroundOnly);
inputParams.isSmooth = GetPortBool(pActInfo, EIP_Smooth);
inputParams.restriction = eRestriction( GetPortInt(pActInfo, EIP_Restriction));
inputParams.view = eViewType( GetPortInt(pActInfo, EIP_ViewType));
inputParams.angle = Ang3(DEG2RAD(GetPortVec3(pActInfo, EIP_Angle)));
inputParams.shift = GetPortVec3(pActInfo, EIP_Shift);
inputParams.frequency = GetPortFloat(pActInfo, EIP_Frequency);
inputParams.randomness = GetPortFloat(pActInfo, EIP_Randomness);
inputParams.distance = GetPortFloat(pActInfo, EIP_Distance);
inputParams.rangeMin = GetPortFloat(pActInfo, EIP_RangeMin);
inputParams.rangeMax = GetPortFloat(pActInfo, EIP_RangeMax);
inputParams.sustainDuration = GetPortFloat(pActInfo, EIP_SustainDuration);
inputParams.fadeInDuration = GetPortFloat(pActInfo, EIP_FadeInDuration);
inputParams.fadeOutDuration = GetPortFloat(pActInfo, EIP_FadeOutDuration);
}
}
示例6: ProcessEvent
virtual void ProcessEvent( EFlowEvent event, SActivationInfo * pActInfo )
{
switch (event)
{
case eFE_Initialize:
case eFE_Activate:
if (IsPortActive(pActInfo, 0))
{
int minOut = GetPortInt(pActInfo,1);
int maxOut = GetPortInt(pActInfo,2);
minOut = CLAMP(minOut, 0, NUM_OUTPUTS);
maxOut = CLAMP(maxOut, 0, NUM_OUTPUTS);
if (maxOut < minOut)
std::swap(minOut, maxOut);
int n = cry_random(minOut, maxOut);
// Collect the outputs to use
static int out[NUM_OUTPUTS];
for (unsigned i = 0; i < NUM_OUTPUTS; i++)
out[i] = -1;
int nout = 0;
for (int i = 0; i < NUM_OUTPUTS; i++)
{
if (IsOutputConnected(pActInfo, i))
{
out[nout] = i;
nout++;
}
}
if (n > nout)
n = nout;
// Shuffle
for (int i = 0; i < n; i++)
std::swap(out[i], out[cry_random(0, nout - 1)]);
// Set outputs.
for (int i = 0; i < n; i++)
{
if (out[i] == -1)
continue;
ActivateOutput(pActInfo,out[i],GetPortAny(pActInfo, 0));
}
}
break;
}
}
示例7: 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;
}
示例8: 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 );
}
}
}
示例9: CRY_ASSERT
void CFlowNode_PrefabEventSource::ProcessEvent( EFlowEvent event, SActivationInfo *pActInfo )
{
ICustomEventManager* pCustomEventManager = gEnv->pGame->GetIGameFramework()->GetICustomEventManager();
CRY_ASSERT( pCustomEventManager != NULL );
if ( event == eFE_Activate )
{
if ( IsPortActive( pActInfo, EIP_FireEvent) )
{
if ( m_eventId != CUSTOMEVENTID_INVALID )
{
pCustomEventManager->FireEvent( m_eventId );
}
// Output port is activated from event
}
}
else if (event == eFE_Initialize)
{
m_actInfo = *pActInfo;
const TCustomEventId eventId = (TCustomEventId)GetPortInt( pActInfo, EIP_EventId );
if ( eventId != CUSTOMEVENTID_INVALID )
{
pCustomEventManager->RegisterEventListener( this, eventId );
}
m_eventId = eventId;
}
}
示例10: 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 );
}
}
示例11: 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 );
}
}
}
示例12: data
Assignment DefendAreaAssignmentFlowNode::SpecifyAssignment( SActivationInfo* pActInfo )
{
SmartScriptTable data(gEnv->pScriptSystem);
data->SetValue("position", GetPortVec3(pActInfo, InputPort_Position));
data->SetValue("radius", GetPortInt(pActInfo, InputPort_Radius));
return Assignment(Assignment::DefendArea, data);
}
示例13: switch
// ---------------------------------------------------------------
void CFlashUIBaseNodeDynPorts::GetDynInput( SUIArguments &args, const SUIParameterDesc &desc, SActivationInfo* pActInfo, int port)
{
switch (desc.eType)
{
case SUIParameterDesc::eUIPT_Bool:
args.AddArgument( GetPortBool(pActInfo, port));
break;
case SUIParameterDesc::eUIPT_Int:
args.AddArgument( GetPortInt(pActInfo, port));
break;
case SUIParameterDesc::eUIPT_Float:
args.AddArgument( GetPortFloat(pActInfo, port));
break;
case SUIParameterDesc::eUIPT_String:
args.AddArgument( GetPortString(pActInfo, port));
break;
case SUIParameterDesc::eUIPT_WString:
args.AddArgument( GetPortString(pActInfo, port), eUIDT_WString );
break;
case SUIParameterDesc::eUIPT_Vec3:
args.AddArgument( GetPortVec3(pActInfo, port));
break;
default:
{
string val;
const TFlowInputData data = GetPortAny(pActInfo, port);
data.GetValueWithConversion(val);
args.AddArgument(val, eUIDT_Any);
}
break;
}
}
示例14: GetInputActor
void CSetEquipmentLoadoutNode ::ProcessEvent( EFlowEvent event, SActivationInfo *pActInfo )
{
if(event == eFE_Activate && IsPortActive(pActInfo, 0))
{
if(pActInfo->pEntity)
{
IActor* pActor = GetInputActor( pActInfo );
CGameRules *pGameRules = g_pGame->GetGameRules();
if(pActor)
{
int packIndex = GetPortInt(pActInfo, eI_EquipLoadout);
CEquipmentLoadout *pEquipmentLoadout = g_pGame->GetEquipmentLoadout();
if(pEquipmentLoadout)
{
pEquipmentLoadout->SetSelectedPackage(packIndex);
pGameRules->SetPendingLoadoutChange();
}
}
}
}
}
示例15: ProcessEvent
virtual void ProcessEvent(EFlowEvent event, SActivationInfo* pActInfo)
{
switch (event)
{
case eFE_Initialize:
{
break;
}
case eFE_Activate:
{
const string& variableName = GetPortString(pActInfo, eIn_VariableName);
if (variableName.empty())
{
CryWarning(VALIDATOR_MODULE_GAME, VALIDATOR_WARNING, "CAction:DRS_SetVariable: Cannot be executed without a Variable Name.");
return;
}
const string& collectionName = GetPortString(pActInfo, eIn_VariableCollectionName);
EntityId entityID = GetPortEntityId(pActInfo, eIn_EntityID);
DRS::IVariableCollection* variableCollection = GetVariableCollection(entityID, collectionName);
if (variableCollection)
{
int newVariableValue = GetPortInt(pActInfo, eIn_IntegerValue);
variableCollection->SetVariableValue(variableName, newVariableValue, true, GetPortFloat(pActInfo, eIn_ResetTime));
ActivateOutput(pActInfo, eOut_VariableCollectionName, variableCollection->GetName().GetText());
}
break;
}
}
}
开发者ID:NightOwlsEntertainment,项目名称:PetBox_A_Journey_to_Conquer_Elementary_Algebra,代码行数:34,代码来源:FlowDynamicResponseVariable.cpp