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


C++ IScriptTable类代码示例

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


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

示例1: p

bool CScriptRMI::SerializeScript( TSerialize ser, IEntity * pEntity )
{
	SSerializeFunctionParams p( ser, pEntity );
	ScriptHandle hdl( &p );
	IScriptTable * pTable = pEntity->GetScriptTable();
	if (pTable)
	{
		SmartScriptTable serTable;
		SmartScriptTable synchedTable;
		pTable->GetValue( "synched", synchedTable );
		if (synchedTable.GetPtr())
		{
			synchedTable->GetValue( HIDDEN_FIELD, serTable );
			if (serTable.GetPtr())
			{
				IScriptSystem * pScriptSystem = pTable->GetScriptSystem();
				pScriptSystem->BeginCall( serTable.GetPtr(), SERIALIZE_FUNCTION );
				pScriptSystem->PushFuncParam( serTable );
				pScriptSystem->PushFuncParam( hdl );
				return pScriptSystem->EndCall();
			}
		}
	}
	return true;
}
开发者ID:aronarts,项目名称:FireNET,代码行数:25,代码来源:ScriptRMI.cpp

示例2: OnSpawn

void CBaseManagerEntitySink::OnSpawn(IEntity *pEntity, SEntitySpawnParams &params)
{
	// Check if it has a CNC Table. If it does, manually add it to the controller
	IScriptTable *pTable;
	if (NULL != pEntity && NULL != (pTable = pEntity->GetScriptTable()))
	{
		// Get property table
		SmartScriptTable props, cncbuilding;
		if (true == pTable->GetValue("Properties", props) &&
			true == props->GetValue("CNCBuilding", cncbuilding))
		{
			// Extract and build GUID
			char const* szTeam = 0;
			char const* szClass = 0;
			cncbuilding->GetValue("Team", szTeam);
			cncbuilding->GetValue("Class", szClass);
			BuildingGUID GUID = m_pManager->GenerateGUID(szTeam, szClass);
			if (GUID_INVALID != GUID)
			{
				// Get controller and manually add it
				IBuildingController *pController = m_pManager->FindBuildingController(GUID);
				if (NULL != pController)
					pController->AddInterface(pEntity);
			}
		}
	}
}
开发者ID:RenEvo,项目名称:dead6,代码行数:27,代码来源:CBaseManager.cpp

示例3: GetEntity

const char *CAnimatedCharacterSample::GetCharacterModelNameFromScriptTable() const
{
	IEntity *pEntity = GetEntity();

	IScriptTable *pScriptTable = pEntity->GetScriptTable();

	if(pScriptTable == NULL)
	{
		return NULL;
	}

	SmartScriptTable propertiesTable;
	const bool hasPropertiesTable = pScriptTable->GetValue("Properties", propertiesTable);

	if(! hasPropertiesTable)
	{
		return NULL;
	}

	const char *modelName = NULL;
	const bool hasModelName = propertiesTable->GetValue("objModel", modelName);

	if(! hasModelName)
	{
		return NULL;
	}

	return modelName;
}
开发者ID:Hellraiser666,项目名称:CryGame,代码行数:29,代码来源:AnimatedCharacterSample.cpp

示例4: GetTeamRadioTable

static bool GetTeamRadioTable(CGameRules *gr, const string &team_name, SmartScriptTable &out_table)
{
	if(!gr)
	{
		return false;
	}

	IScriptTable *pTable = gr->GetEntity()->GetScriptTable();

	if(!pTable)
	{
		return false;
	}

	SmartScriptTable pTeamRadio;

	if(!pTable->GetValue("teamRadio", pTeamRadio))
	{
		return false;
	}

	if(!pTeamRadio->GetValue(team_name, out_table))
	{
		return false;
	}

	return true;
}
开发者ID:Oliverreason,项目名称:bare-minimum-cryengine3,代码行数:28,代码来源:Radio.cpp

示例5: DetachFrom

//------------------------------------------------------------------------
void CScriptBind_Inventory::DetachFrom(CInventory* pInventory)
{
	IScriptTable *pScriptTable = pInventory->GetEntity()->GetScriptTable();

	if (pScriptTable)
		pScriptTable->SetToNull("inventory");
}
开发者ID:aronarts,项目名称:FireNET,代码行数:8,代码来源:ScriptBind_Inventory.cpp

示例6: createScriptTable

IScriptTable* ScriptSystem::createScriptTable()
{
	IScriptTable* table = new IScriptTable;
	table->mKeyTable = &mKeyTable;
	table->addRef();
	return table;
}
开发者ID:uvbs,项目名称:GameProject,代码行数:7,代码来源:IScriptTable.cpp

示例7: CRY_ASSERT

void CProceduralContextAim::InitialisePoseBlenderAim()
{
	CRY_ASSERT( m_entity );

	const int slot = 0;
	ICharacterInstance* pCharacterInstance = m_entity->GetCharacter( slot );
	if ( pCharacterInstance == NULL )
	{
		return;
	}

	ISkeletonPose* pSkeletonPose = pCharacterInstance->GetISkeletonPose();
	if ( pSkeletonPose == NULL )
	{
		return;
	}

	m_pPoseBlenderAim = pSkeletonPose->GetIPoseBlenderAim();

	if ( m_pPoseBlenderAim )
	{
		m_defaultPolarCoordinatesSmoothTimeSeconds = 0.1f;
		float polarCoordinatesMaxYawDegreesPerSecond = 360.f;
		float polarCoordinatesMaxPitchDegreesPerSecond = 360.f;
		float fadeInSeconds = 0.25f;
		float fadeOutSeconds = 0.25f;
		float fadeOutMinDistance = 0.f;

		IScriptTable* pScriptTable = m_entity->GetScriptTable();
		if ( pScriptTable )
		{
			SmartScriptTable pProceduralContextAimTable;
			pScriptTable->GetValue( "ProceduralContextAim", pProceduralContextAimTable );
			if ( pProceduralContextAimTable )
			{
				pProceduralContextAimTable->GetValue( "polarCoordinatesSmoothTimeSeconds", m_defaultPolarCoordinatesSmoothTimeSeconds );
				pProceduralContextAimTable->GetValue( "polarCoordinatesMaxYawDegreesPerSecond", polarCoordinatesMaxYawDegreesPerSecond );
				pProceduralContextAimTable->GetValue( "polarCoordinatesMaxPitchDegreesPerSecond", polarCoordinatesMaxPitchDegreesPerSecond );
				pProceduralContextAimTable->GetValue( "fadeInSeconds", fadeInSeconds );
				pProceduralContextAimTable->GetValue( "fadeOutSeconds", fadeOutSeconds );
				pProceduralContextAimTable->GetValue( "fadeOutMinDistance", fadeOutMinDistance );
			}
		}

		m_defaultPolarCoordinatesMaxSmoothRateRadiansPerSecond = Vec2( DEG2RAD( polarCoordinatesMaxYawDegreesPerSecond ), DEG2RAD( polarCoordinatesMaxPitchDegreesPerSecond ) );

		m_pPoseBlenderAim->SetPolarCoordinatesSmoothTimeSeconds( m_defaultPolarCoordinatesSmoothTimeSeconds );
		m_pPoseBlenderAim->SetPolarCoordinatesMaxRadiansPerSecond( m_defaultPolarCoordinatesMaxSmoothRateRadiansPerSecond );
		m_pPoseBlenderAim->SetFadeInSpeed( fadeInSeconds );
		m_pPoseBlenderAim->SetFadeOutSpeed( fadeOutSeconds );
		m_pPoseBlenderAim->SetFadeOutMinDistance( fadeOutMinDistance );
		m_pPoseBlenderAim->SetState( false );
	}
}
开发者ID:danielasun,项目名称:dbho-GameSDK,代码行数:54,代码来源:ProceduralContextAim.cpp

示例8: GetEntity

bool CTornado::Reset()
{
	//Initialize default values before (in case ScriptTable fails)
	m_wanderSpeed = 10.0f;
	m_cloudHeight = 376.0f;
	m_radius = 300.0f;

	m_spinImpulse = 9.0f;
	m_attractionImpulse = 13.0f;
	m_upImpulse = 18.0f;

	const char* funnelEffect = 0;

	SmartScriptTable props;
	IScriptTable* pScriptTable = GetEntity()->GetScriptTable();
	if(!pScriptTable || !pScriptTable->GetValue("Properties", props))
		return false;

	props->GetValue("fWanderSpeed", m_wanderSpeed);
	props->GetValue("fCloudHeight", m_cloudHeight);
	props->GetValue("Radius", m_radius);
		
	props->GetValue("fSpinImpulse", m_spinImpulse);
	props->GetValue("fAttractionImpulse", m_attractionImpulse);
	props->GetValue("fUpImpulse", m_upImpulse);
  
	props->GetValue("FunnelEffect", funnelEffect);
	if (!UseFunnelEffect(funnelEffect))
		return false;

	Matrix34 m = GetEntity()->GetWorldTM();
	m_wanderDir = m.GetColumn(1)*0.414214f;

	m_isOnWater = false;
	m_isInAir = false;

	m_nextEntitiesCheck = 0;

	Vec3 pos = GetEntity()->GetWorldPos();
	gEnv->pLog->Log("TORNADO INIT POS: %f %f %f", pos.x, pos.y, pos.z);
	m_points[0] = pos;
	m_points[1] = pos + Vec3(0,0,m_cloudHeight/8.0f);
	m_points[2] = pos + Vec3(0,0,m_cloudHeight/2.0f);
	m_points[3] = pos + Vec3(0,0,m_cloudHeight);
	for (int i=0; i<4; ++i)
		m_oldPoints[i] = m_points[i];

	m_currentPos = GetEntity()->GetWorldPos();
	CHANGED_NETWORK_STATE(this, POSITION_ASPECT);
	
	UpdateTornadoSpline();

	return true;
}
开发者ID:Xydrel,项目名称:Infected,代码行数:54,代码来源:Tornado.cpp

示例9: AttachTo

//------------------------------------------------------------------------
void CScriptBind_MatchMaking::AttachTo( CMatchMakingHandler* pMatchMaking, CGameLobbyManager *pLobbyManager )
{
	m_pLobbyManager = pLobbyManager;
	IScriptTable *pScriptTable = pMatchMaking->GetScriptTable();

	if (pScriptTable)
	{
		SmartScriptTable thisTable(m_pSS);
		thisTable->Delegate(GetMethodsTable());

		pScriptTable->SetValue("bindings", thisTable);
	}
}
开发者ID:danielasun,项目名称:dbho-GameSDK,代码行数:14,代码来源:ScriptBind_MatchMaking.cpp

示例10: return

bool CSmartMine::ShouldStartTrackingEntity( const EntityId entityId ) const
{
	// Always track player...
	if (entityId == g_pGame->GetIGameFramework()->GetClientActorId())
	{
		return true;
	}

	// ... or any AI
	const SAutoaimTarget* pTargetInfo = g_pGame->GetAutoAimManager().GetTargetInfo( entityId );
	if(pTargetInfo != NULL)
	{
		return (pTargetInfo->pActorWeak.lock() != NULL);
	}

	// Also track kickable and pickable objects
	IEntity* pEntity = gEnv->pEntitySystem->GetEntity( entityId );
	IScriptTable* pScriptTable = (pEntity != NULL) ? pEntity->GetScriptTable() : NULL;
	if(pScriptTable != NULL)
	{
		SmartScriptTable propertiesTable;
		if(pScriptTable->GetValue("Properties", propertiesTable))
		{
			int pickable = 0, kickable = 0;
			propertiesTable->GetValue("bPickable", pickable);
			propertiesTable->GetValue("bInteractLargeObject", kickable);

			if(pickable)
			{
				// Filter out items/weapons
				pickable = (g_pGame->GetIGameFramework()->GetIItemSystem()->GetItem(entityId) == NULL);
			}

			if (pickable || kickable)
			{
				//Check if object is moving
				IPhysicalEntity* pEntityPhysics = pEntity->GetPhysics();
				if(pEntityPhysics != NULL)
				{
					pe_status_dynamics entityDynamics;
					if(pEntityPhysics->GetStatus(&entityDynamics))
					{
						return (entityDynamics.v.len2() > 0.1f);
					}
				}
			}
		}
	}

	return false;
}
开发者ID:Kufusonic,项目名称:Work-in-Progress-Sonic-Fangame,代码行数:51,代码来源:SmartMine.cpp

示例11: ProcessEvent

  virtual void ProcessEvent( EFlowEvent event, SActivationInfo *pActInfo )
  {
    switch (event)
    {    
    case eFE_Activate:
      {
        IActor* pActor = GetAIActor(pActInfo);
        if (!pActor)
          break;
        
        IEntity* pEnt = pActor->GetEntity();
        if (!pEnt)
          break;
        
        HSCRIPTFUNCTION func = 0;
        int ret = 0;
        IScriptTable* pTable = pEnt->GetScriptTable();
        if (!pTable)
          break;

        if (IsPortActive(pActInfo, 1) && pTable->GetValue("GrabObject", func))
        {                   
          IEntity* pObj = gEnv->pEntitySystem->GetEntity( GetPortEntityId(pActInfo, 0) );
          if (pObj)
          {
            IScriptTable* pObjTable = pObj->GetScriptTable();
            Script::CallReturn(gEnv->pScriptSystem, func, pTable, pObjTable, ret);
          }
          ActivateOutput(pActInfo, 0, ret);
        }  
        else if (IsPortActive(pActInfo, 2) && pTable->GetValue("DropObject", func))
        {
          bool bThrow = GetPortBool(pActInfo, 3);
          Script::CallReturn(gEnv->pScriptSystem, func, pTable, bThrow, ret);
          ActivateOutput(pActInfo, 0, ret);
        }
        
        if (pTable->GetValue("GetGrabbedObject", func))
        {          
          ScriptHandle sH(0);
          Script::CallReturn(gEnv->pScriptSystem, func, pTable, sH);
          ActivateOutput(pActInfo, 1, EntityId(sH.n));
        }
        
				if(func)
					gEnv->pScriptSystem->ReleaseFunc(func);

        break;
      }
    }
  }
开发者ID:NightOwlsEntertainment,项目名称:PetBox_A_Journey_to_Conquer_Elementary_Algebra,代码行数:51,代码来源:FlowGameNodes.cpp

示例12: OnSysSpecLightChange

// for editor only
static void OnSysSpecLightChange( ICVar *pVar )
{
	IEntityItPtr it	= GetIEntitySystem()->GetEntityIterator();
	it->MoveFirst();

	while(IEntity *pEntity = it->Next())
	{
		IScriptTable *pScriptTable = pEntity->GetScriptTable();
		if (pScriptTable && pScriptTable->HaveValue("OnSysSpecLightChanged"))
		{
			Script::CallMethod( pScriptTable, "OnSysSpecLightChanged" );
		}
	}
}
开发者ID:amrhead,项目名称:eaascode,代码行数:15,代码来源:EntityCVars.cpp

示例13: GetEntity

void CVicinityDependentObjectMover::SetupEntity()
{
	const char* szModelName = VICINITYDEPENDENTOBJECTMOVER_MODEL_NORMAL;
	float fMoveToDistance = 10.0f;
	float fAreaTriggerRange = 10.0f;
	float fBackAreaTriggerRange = 10.0f;
	float fForceMoveCompleteDistance = 1.0f;

	IEntity* pEntity = GetEntity();
	CRY_ASSERT( pEntity != NULL );

	IScriptTable* pScriptTable = pEntity->GetScriptTable();
	if ( pScriptTable != NULL )
	{
		SmartScriptTable propertiesTable;
		if ( pScriptTable->GetValue( "Properties", propertiesTable) )
		{
			propertiesTable->GetValue( "objModel", szModelName );
			propertiesTable->GetValue( "fMoveToDistance", fMoveToDistance );
			propertiesTable->GetValue( "fMoveToSpeed", m_fMoveToSpeed );
			propertiesTable->GetValue( "fMoveBackSpeed", m_fMoveBackSpeed );
			propertiesTable->GetValue( "fAreaTriggerRange", fAreaTriggerRange );
			propertiesTable->GetValue( "fBackAreaTriggerRange", fBackAreaTriggerRange );
			propertiesTable->GetValue( "fForceMoveCompleteDistance", fForceMoveCompleteDistance );
			propertiesTable->GetValue( "bUseAreaTrigger", m_bUseAreaTrigger );
			propertiesTable->GetValue( "bDisableAreaTriggerOnMoveComplete", m_bDisableAreaTriggerOnMoveComplete );
		}
	}

	m_fMoveToDistance = fMoveToDistance;
	m_fMoveToDistanceSq = fMoveToDistance*fMoveToDistance;
	m_fAreaTriggerRange = fAreaTriggerRange;
	m_fAreaTriggerRangeSq = fAreaTriggerRange*fAreaTriggerRange;
	m_fBackAreaTriggerRange = fBackAreaTriggerRange;
	m_fBackAreaTriggerRangeSq = fBackAreaTriggerRange*fBackAreaTriggerRange;
	m_fForceMoveCompleteDistanceSq = fForceMoveCompleteDistance*fForceMoveCompleteDistance;

	// Load model
	pEntity->LoadGeometry( VICINITYDEPENDENTOBJECTMOVER_MODEL_NORMAL_SLOT, szModelName );

	// Draw slot and physicalize it
	DrawSlot( VICINITYDEPENDENTOBJECTMOVER_MODEL_NORMAL_SLOT, true );

	SEntityPhysicalizeParams physicalizeParams;
	physicalizeParams.nSlot = VICINITYDEPENDENTOBJECTMOVER_MODEL_NORMAL_SLOT;
	physicalizeParams.type = PE_RIGID;
	physicalizeParams.mass = 0;

	GetEntity()->Physicalize( physicalizeParams );
}
开发者ID:Kufusonic,项目名称:Work-in-Progress-Sonic-Fangame,代码行数:50,代码来源:VicinityDependentObjectMover.cpp

示例14: AttachTo

//------------------------------------------------------------------------
void CScriptBind_Item::AttachTo(CItem *pItem)
{
	IScriptTable *pScriptTable = pItem->GetEntity()->GetScriptTable();

	if (pScriptTable)
	{
		SmartScriptTable thisTable(m_pSS);

		thisTable->SetValue("__this", ScriptHandle(pItem->GetEntityId()));
		thisTable->Delegate(GetMethodsTable());

		pScriptTable->SetValue("item", thisTable);
	}
}
开发者ID:Xydrel,项目名称:Infected,代码行数:15,代码来源:ScriptBind_Item.cpp

示例15: AttachTo

//------------------------------------------------------------------------
void CScriptBind_Actor::AttachTo(CActor *pActor)
{
	IScriptTable *pScriptTable = pActor->GetEntity()->GetScriptTable();

	if (pScriptTable)
	{
		SmartScriptTable thisTable(m_pSS);

		thisTable->SetValue("__this", ScriptHandle(pActor->GetEntityId()));
		thisTable->Delegate(GetMethodsTable());

		pScriptTable->SetValue("actor", thisTable);
	}
}
开发者ID:mrwonko,项目名称:CrysisVR,代码行数:15,代码来源:ScriptBind_Actor.cpp


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