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


C++ TSerialize::Value方法代码示例

本文整理汇总了C++中TSerialize::Value方法的典型用法代码示例。如果您正苦于以下问题:C++ TSerialize::Value方法的具体用法?C++ TSerialize::Value怎么用?C++ TSerialize::Value使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TSerialize的用法示例。


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

示例1: Serialize

//------------------------------------------------------------------------
void CVehicleDamageBehaviorBurn::Serialize(TSerialize ser, EEntityAspects aspects)
{
	if(ser.GetSerializationTarget()!=eST_Network)
	{
		bool active = m_isActive;
		ser.Value("Active", active);
		ser.Value("time", m_timeCounter);
		ser.Value("shooterId", m_shooterId);

		if(ser.IsReading())
		{
			if(active != m_isActive)
				Activate(active);
		}
	}
}
开发者ID:super-nova,项目名称:NovaRepo,代码行数:17,代码来源:VehicleDamageBehaviorBurn.cpp

示例2: Serialize

//------------------------------------------------------------------------
void CPlant::Serialize(TSerialize ser)
{
	if (ser.GetSerializationTarget()!=eST_Network)
	{
		ser.Value("projectiles", m_projectiles);
	}
}
开发者ID:Xydrel,项目名称:Infected,代码行数:8,代码来源:Plant.cpp

示例3: FullSerialize

//----------------------------------------------------------------------
void CVehicleMountedWeapon::FullSerialize(TSerialize ser)
{
	CHeavyMountedWeapon::FullSerialize(ser);
	ser.BeginGroup("VehicleMountedWeapon");
	ser.Value("vehicleId", m_vehicleId);
	ser.EndGroup();
}
开发者ID:amrhead,项目名称:eaascode,代码行数:8,代码来源:VehicleMountedWeapon.cpp

示例4: Serialize

//------------------------------------------------------------------------
void CVehicleDamageBehaviorBlowTire::Serialize(TSerialize ser, EEntityAspects aspects)
{
  if (ser.GetSerializationTarget() != eST_Network)
  { 
		if (ser.IsReading())
			Activate(false); // reset

		bool bActive;

    ser.Value("isActive", bActive);
    ser.Value("component", m_component);
    ser.Value("immobilizedTimer", m_aiImmobilizedTimer);
   		  
		Activate(bActive);    		
  }
}
开发者ID:kitnet,项目名称:project-o,代码行数:17,代码来源:VehicleDamageBehaviorTire.cpp

示例5: NetSerialize

//------------------------------------------------------------------------
bool CGameRulesHoldObjectiveBase::NetSerialize( TSerialize ser, EEntityAspects aspect, uint8 profile, int flags )
{
	if (aspect == HOLD_OBJECTIVE_STATE_ASPECT)
	{
		for (int i = 0; i < HOLD_OBJECTIVE_MAX_ENTITIES; ++ i)
		{
			SHoldEntityDetails *pDetails = &m_entities[i];

			int oldTeam1Count = pDetails->m_insideCount[0];
			int oldTeam2Count = pDetails->m_insideCount[1];

			int team1Count = pDetails->m_insideEntities[0].size();
			int team2Count = pDetails->m_insideEntities[1].size();

			ser.Value("team1Players", team1Count, 'ui5');
			ser.Value("team2Players", team2Count, 'ui5');

			pDetails->m_serializedInsideCount[0] = team1Count;
			pDetails->m_serializedInsideCount[1] = team2Count;

			OnNetSerializeHoldEntity(ser, aspect, profile, flags, pDetails, i);

		}
		if (ser.IsReading())
		{
			// Mark as changed - do the actual work in the update function so we're not holding onto the network mutex
			m_bHasNetSerialized = true;
		}
	}
	
	return true;
}
开发者ID:aronarts,项目名称:FireNET,代码行数:33,代码来源:GameRulesHoldObjectiveBase.cpp

示例6: SerializeSpawnInfo

//------------------------------------------------------------------------
void CAmmoPickup::SerializeSpawnInfo( TSerialize ser )
{
	uint16 ammoClassId;
	string modelName;
	int count;
	ser.Value("modelName", modelName);
	ser.Value("classId", ammoClassId, 'ui16');
	ser.Value("count", count, 'ammo');
	m_modelName=modelName;

	static char ammoClassName[129]={0};
	g_pGame->GetIGameFramework()->GetNetworkSafeClassName(ammoClassName, 128, ammoClassId);

	m_ammoName=ammoClassName;
	m_ammoCount=count;
}
开发者ID:Adi0927,项目名称:alecmercer-origins,代码行数:17,代码来源:AmmoPickup.cpp

示例7: Serialize

//------------------------------------------------------------------------
void CVehicleMovementHelicopter::Serialize(TSerialize ser, EEntityAspects aspects)
{
    CVehicleMovementBase::Serialize(ser, aspects);

    if (ser.GetSerializationTarget() == eST_Network)
        {
            m_netActionSync.Serialize(ser, aspects);
        }
    else
        {
            ser.Value("enginePower", m_enginePower);
            //ser.Value("turbulence", m_turbulence);

            ser.Value("steeringDamage",m_steeringDamage);
        }
}
开发者ID:eBunny,项目名称:EmberProject,代码行数:17,代码来源:VehicleMovementHelicopter.cpp

示例8: Serialize

//------------------------------------------------------------------------
void CVehicleDamageBehaviorExplosion::Serialize(TSerialize ser, EEntityAspects aspects)
{
  if (ser.GetSerializationTarget() != eST_Network)
  {
    ser.Value("exploded", m_exploded);
  }
}
开发者ID:AiYong,项目名称:CryGame,代码行数:8,代码来源:VehicleDamageBehaviorExplosion.cpp

示例9: NetSerialize

bool CNetworkBuilding::NetSerialize( TSerialize ser, EEntityAspects aspect, uint8 profile, int pflags )
{
	if (aspect == POSITION_ASPECT)
	{
		if(gEnv->bServer && !gEnv->IsEditor())
		{
			int cur_state = (int)m_state;
			ws->SetInt(entity_name,"BuildStatus",build_status);
			ws->SetInt(entity_name,"EntityState",cur_state);
		}

		EState newState = m_state;
		ser.EnumValue("cur_state", newState, eState_NotUsed, eState_Done);
		ser.Value( "build_status", build_status);

		if (ser.IsWriting())
		{
			//CryLog("CNetworkBuilding::NetSerialize writing !!!");			
		}

		if (ser.IsReading())
		{
			//CryLog("CNetworkBuilding::NetSerialize reading !!!");
			m_state = newState;
			Building(build_status);
		}
	}

	return true;
}
开发者ID:aronarts,项目名称:FireNET,代码行数:30,代码来源:NetworkBuilding.cpp

示例10: Serialize

//------------------------------------------------------------------------
void CVehicleDamageBehaviorDetachPart::Serialize(TSerialize ser, EEntityAspects aspects)
{
	if (ser.GetSerializationTarget() != eST_Network)
	{
    EntityId detachedId = m_detachedEntityId;
		ser.Value("m_detachedEntityId", detachedId);
		
		if (ser.IsReading() && m_detachedEntityId != detachedId)
		{
      if (detachedId)
      {
        m_detachedEntityId = detachedId;
        
        if (IEntity* pDetachedEntity = gEnv->pEntitySystem->GetEntity(m_detachedEntityId))
        {
          if (CVehiclePartBase* pPart = (CVehiclePartBase*)m_pVehicle->GetPart(m_partName.c_str()))
            MovePartToTheNewEntity(pDetachedEntity, pPart);
        }        
      }		
      else
      {        
        Reset();                
      }
		}
	}
}
开发者ID:aronarts,项目名称:FireNET,代码行数:27,代码来源:VehicleDamageBehaviorDetachPart.cpp

示例11: Serialize

//------------------------------------------------------------------------
void CVehicleMovementStdBoat::Serialize(TSerialize ser, EEntityAspects aspects) 
{
	CVehicleMovementBase::Serialize(ser, aspects);

  if (ser.GetSerializationTarget() == eST_Network) 
  {
    if (m_bNetSync && aspects & CNetworkMovementStdBoat::CONTROLLED_ASPECT)
      m_netActionSync.Serialize(ser, aspects);
  }
  else
  {
    ser.Value("m_prevAngle", m_prevAngle);
    ser.Value("lifted", m_lifted);
		ser.Value("factorMaxSpeed", m_factorMaxSpeed);
		ser.Value("factorAccel", m_factorAccel);
  }
};
开发者ID:souxiaosou,项目名称:FireNET,代码行数:18,代码来源:VehicleMovementStdBoat.cpp

示例12:

void CMonoEntityExtension::RMIParams::SerializeWith(TSerialize ser)
{
	IMonoArray *pArgs;
	int length;

	if(args != nullptr)
	{
		pArgs = *args;
		length = pArgs->GetSize();
	}
	else
		length = 0;

	ser.Value("length", length);

	ser.Value("methodName", methodName);
	ser.Value("targetId", targetId, 'eid');

	if(length > 0)
	{
		if(ser.IsWriting())
		{
			for(int i = 0; i < length; i++)
			{
				IMonoObject *pItem = *pArgs->GetItem(i);
				pItem->GetAnyValue().SerializeWith(ser);
				SAFE_RELEASE(pItem);
			}
		}
		else
		{
			pArgs = g_pScriptSystem->GetScriptDomain()->CreateArray(length);

			for(int i = 0; i < length; i++)
			{
				MonoAnyValue value;
				value.SerializeWith(ser);
				pArgs->InsertAny(value, i);
			}

			args = pArgs->GetManagedObject();
		}

		pArgs->Release();
	}
}
开发者ID:nathanpapke,项目名称:CryMono,代码行数:46,代码来源:MonoEntity.cpp

示例13: NetSerialize

//------------------------------------------------------------------------
bool CTornado::NetSerialize( TSerialize ser, EEntityAspects aspect, uint8 profile, int flags )
{
	if (aspect == POSITION_ASPECT)
	{
		ser.Value("Pos", m_currentPos, 'wrld');
	}
	return true;
}
开发者ID:Xydrel,项目名称:Infected,代码行数:9,代码来源:Tornado.cpp

示例14: Serialize

	void Serialize( SActivationInfo * pActInfo, TSerialize ser )
	{
		int val = m_lastColourPortTriggered;
		ser.Value( "m_lastColourPortTriggered", val );
		m_lastColourPortTriggered = (EOut)val;
		m_actInfo = *pActInfo;
		UpdateListenerStatus( pActInfo );
	}
开发者ID:PiratesAhoy,项目名称:HeartsOfOak-Core,代码行数:8,代码来源:AINodes.cpp

示例15: Serialize

 void Serialize(SActivationInfo *, TSerialize ser)
 {
     ser.Value("m_listening", m_listening);
     if(ser.IsReading())
     {
         g_pGame->GetUI()->RegisterControlSchemeListener(this);
     }
 }
开发者ID:souxiaosou,项目名称:FireNET,代码行数:8,代码来源:FlowNodesInput.cpp


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