• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ TSerialize类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: Serialize

//------------------------------------------------------------------------
void CVehicleSeatActionRotateTurret::Serialize(TSerialize ser, EEntityAspects aspects)
{
	// MR: for network, only turret parts are serialized
	// for savegame, all parts are serialized (by CVehicle)
	if (ser.GetSerializationTarget() == eST_Network)
	{
		for (int i = 0; i < eVTRT_NumRotationTypes; ++i)
		{
			if (m_rotations[i].m_pPart)
			{
				m_rotations[i].m_pPart->Serialize(ser, aspects);
			}
		}
	}
	else
	{
		// save rotation details
		CryFixedStringT<16> tag;
		for (int i = 0; i < eVTRT_NumRotationTypes; ++i)
		{
			if (m_rotations[i].m_pPart)
			{
				Quat     q;
				Matrix34 currentTM = m_rotations[i].m_pPart->GetLocalBaseTM();
				if (ser.IsWriting())
					q = Quat(currentTM);

				tag = (i == eVTRT_Pitch) ? "rotation_pitch" : "rotation_yaw";
				ser.Value(tag.c_str(), q, 'ori1');

				if (ser.IsReading())
				{
					Matrix34 newTM(q);
					newTM.SetTranslation(currentTM.GetTranslation());
					m_rotations[i].m_pPart->SetLocalBaseTM(newTM);
					m_rotations[i].m_orientation.Set(q);
				}
			}
		}
	}
}
开发者ID:joewan,项目名称:pycmake,代码行数:42,代码来源:VehicleSeatActionRotateTurret.cpp


示例2: NetSerialize

bool CHeavyMountedWeapon::NetSerialize(TSerialize ser, EEntityAspects aspect, uint8 profile, int flags)
{
	if (!BaseClass::NetSerialize(ser, aspect, profile, flags))
		return false;

	if(aspect == ASPECT_RIPOFF)
	{
		ser.Value("ripOff", static_cast<CHeavyMountedWeapon*>(this), &CHeavyMountedWeapon::IsRippingOrRippedOff, &CHeavyMountedWeapon::SetRippingOff, 'bool');
	}

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


示例3: Serialize

void CMultipleGrabHandler::Serialize(TSerialize ser)
{
	int numHandlers;
	if (ser.IsWriting())
		numHandlers = m_handlers.size();

	ser.Value("numHandlers", numHandlers);

	if (ser.IsReading())
	{
		for (int i=0; i < numHandlers; ++i)
		{
			m_handlers.push_back (new CAnimatedGrabHandler (m_pActor));
		}
	}

	std::vector <CAnimatedGrabHandler*>::iterator it = m_handlers.begin();
	std::vector <CAnimatedGrabHandler*>::iterator end = m_handlers.end();
	for ( ; it != end; ++it)
		(*it)->Serialize (ser);
}
开发者ID:AiYong,项目名称:CryGame,代码行数:21,代码来源:GrabHandler.cpp


示例4: FullSerialize

void CDoorPanel::FullSerialize( TSerialize serializer )
{
	if (serializer.IsReading())
	{
		m_fLastVisibleDistanceCheckTime = 0.0f;
		int iCurrentState = (int)eDoorPanelBehaviorState_Idle;
		serializer.Value( "CurrentState", iCurrentState );
		const EDoorPanelBehaviorState stateId = (EDoorPanelBehaviorState)iCurrentState;
		if (stateId != eDoorPanelBehaviorState_Invalid)
		{
			m_currentState = stateId;
		}
	}
	else
	{
		int iCurrentState = (int)m_currentState;
		serializer.Value( "CurrentState", iCurrentState );
	}
	
	StateMachineSerializeBehavior( SStateEventSerialize(serializer) );
}
开发者ID:PiratesAhoy,项目名称:HeartsOfOak-Core,代码行数:21,代码来源:DoorPanel.cpp


示例5: FullSerialize

void CSmartMine::FullSerialize( TSerialize ser )
{
	uint32 targetCount = m_trackedEntities.size();

	ser.Value( "MineEnabled", m_enabled );
	ser.Value( "MineFaction", m_factionId );
	ser.Value( "MineTargetCount", targetCount );

	CryFixedStringT<16> targetName;
	if (ser.IsReading())
	{
		m_trackedEntities.clear();
		for(uint32 i = 0; i < targetCount; ++i)
		{
			m_trackedEntities.push_back();
			targetName.Format( "MineTarget_%d", i );
			ser.Value( targetName.c_str(), m_trackedEntities[i] );
		}
	}
	else
	{
		for(uint32 i = 0; i < targetCount; ++i)
		{
			targetName.Format( "MineTarget_%d", i );
			ser.Value( targetName.c_str(), m_trackedEntities[i] );
		}
	}

	StateMachineSerializeBehavior( SStateEventSerialize( ser ) );
}
开发者ID:Kufusonic,项目名称:Work-in-Progress-Sonic-Fangame,代码行数:30,代码来源:SmartMine.cpp


示例6: FullSerialize

//------------------------------------------------------------------
void CLam::FullSerialize(TSerialize ser)
{
    CAccessory::FullSerialize(ser);

    if(ser.IsReading())
    {
        ActivateLight(false);
        ActivateLaser(false);
        m_lastLaserHitPt.Set(0,0,0);
        m_lastLaserHitSolid = false;
        m_smoothLaserLength = -1.0f;
        DestroyLaserEntity();
        m_laserHelperFP.clear();
        m_allowUpdate = false;
        m_updateTime = 0.0f;
    }

    m_laserActiveSerialize = m_laserActivated;
    ser.Value("laserActivated", m_laserActiveSerialize);
    m_lightActiveSerialize = m_lightActivated;
    ser.Value("lightActivated", m_lightActiveSerialize);
}
开发者ID:j30206868,项目名称:NetWars_cpp,代码行数:23,代码来源:Lam.cpp


示例7: Serialize

	virtual void Serialize(SActivationInfo *pActInfo, TSerialize ser)
	{
		ser.Value("m_bPlaying", m_bPlaying);
		ser.Value("m_direction", m_direction);
		ser.Value("m_postSerializeTrigger", m_postSerializeTrigger);

		if (ser.IsReading())
		{
			// in case we were playing before the fader is stopped on load,
			// but still we need to activate outputs. this MUST NOT be done in serialize
			// but in ProcessEvent
			if (m_bPlaying)
			{
				pActInfo->pGraph->SetRegularlyUpdated(pActInfo->myID, true);
				m_postSerializeTrigger = m_direction;
			}
			m_bPlaying = false;
			m_bNeedFaderStop = false;
			m_ticket = 0;
			m_direction = 0;
		}
	}
开发者ID:aronarts,项目名称:FireNET,代码行数:22,代码来源:FlowFadeNode.cpp


示例8: SerializeWith

		void SerializeWith( TSerialize ser )
		{
			ser.Value("hostId", hostId, 'eid');
			ser.Value("ownerId", ownerId, 'eid');
			ser.Value("weaponId", weaponId, 'eid');
			ser.Value("fmId", fmId, 'fmod');
			ser.Value("pos", pos, 'wrld');
			ser.Value("dir", dir, 'dir0');
			ser.Value("vel", vel, 'vel0');
			ser.Value("tracked", tracked, 'bool');
		}
开发者ID:mrwonko,项目名称:CrysisVR,代码行数:11,代码来源:Projectile.cpp


示例9: FullSerialize

void CPlayerRotation::FullSerialize( TSerialize ser )
{
	ser.BeginGroup( "PlayerRotation" );
	ser.Value( "viewAngles" , m_viewAngles );
	ser.Value( "leanAmount", m_leanAmount );
	ser.Value( "viewRoll", m_viewRoll );

	//[AlexMcC|19.03.10]: TODO: delete these once we stop reviving players on quick load!
	// When we don't revive, these are overwritten by a calculation that reads from m_viewAngles,
	// which we serialize above.
	ser.Value( "viewQuat", m_viewQuat );
	ser.Value( "viewQuatFinal", m_viewQuatFinal );
	ser.Value( "baseQuat", m_baseQuat );
	ser.EndGroup();
}
开发者ID:aronarts,项目名称:FireNET,代码行数:15,代码来源:PlayerRotation.cpp


示例10: Serialize

void CHUDMissionObjective::Serialize(TSerialize ser)
{
	//ser.Value("m_shortMessage", m_shortMessage);
	//ser.Value("m_screenMessage", m_screenMessage);
	//ser.Value("m_id", m_id);

	ser.Value("m_trackedEntity", m_trackedEntity);
	ser.EnumValue("m_eStatus", m_eStatus, FIRST, LAST);
	ser.Value("m_silent", m_silent);
	ser.Value("m_secondary", m_secondary);

	if(ser.IsReading())
	{
		if(m_eStatus != DEACTIVATED)
		{
			m_lastTimeChanged = gEnv->pTimer->GetFrameStartTime().GetSeconds();
		}

		m_pMOS = g_pGame->GetMOSystem();

		SetTrackedEntity(m_trackedEntity.c_str());
	}
}
开发者ID:amrhead,项目名称:eaascode,代码行数:23,代码来源:HUDMissionObjectiveSystem.cpp


示例11: Serialize

//------------------------------------------------------------------------
void CVehicleMovementWarrior::Serialize(TSerialize ser, EEntityAspects aspects)
{
  CVehicleMovementHovercraft::Serialize(ser, aspects);

  if (ser.GetSerializationTarget() != eST_Network)
  {
    ser.Value("m_thrustersDamaged", m_thrustersDamaged);
    ser.Value("m_collapseTimer", m_collapseTimer);
    ser.Value("m_collapsed", m_collapsed);
    ser.Value("m_platformDown", m_platformDown);

    char buf[16];    
    for (int i=0; i<m_numThrusters; ++i)
    {
      _snprintf(buf, 16, "thruster_%d", i);
      ser.BeginGroup(buf);
      ser.Value("enabled", m_vecThrusters[i]->enabled);
      ser.Value("heightAdaption", m_vecThrusters[i]->heightAdaption);
      ser.Value("hoverVariance", m_vecThrusters[i]->hoverVariance);            
      ser.EndGroup();
    }    
  }
}
开发者ID:AiYong,项目名称:CryGame,代码行数:24,代码来源:VehicleMovementWarrior.cpp


示例12: Serialize

void CSoundMoods::Serialize(TSerialize ser)
{
    if(!m_pSoundMoodManager)
        return;

    uint uiSoundMood = 0;
    for(TVectorSoundMoods::iterator iter=m_vecSoundMoods.begin(); iter!=m_vecSoundMoods.end(); ++iter,++uiSoundMood)
    {
        SSoundMood *pSoundMood = &(*iter);

        char szTemp[256];
        sprintf(szTemp,"strSoundMood_%d",	uiSoundMood);
        ser.Value(szTemp,pSoundMood->strSoundMood);
        sprintf(szTemp,"uiFadeOutTime_%d",uiSoundMood);
        ser.Value(szTemp,pSoundMood->uiFadeOutTime);
        sprintf(szTemp,"uiFadeOut_%d",		uiSoundMood);
        ser.Value(szTemp,pSoundMood->uiFadeOut);
        sprintf(szTemp,"bValid_%d",				uiSoundMood);
        ser.Value(szTemp,pSoundMood->bValid);
        sprintf(szTemp,"bUnlimited_%d",		uiSoundMood);
        ser.Value(szTemp,pSoundMood->bUnlimited);
    }
}
开发者ID:whztt07,项目名称:CrysisVR,代码行数:23,代码来源:SoundMoods.cpp


示例13:

void CTacticalManager::STacticalInterestPoint::Serialize(TSerialize ser)
{
	ser.Value("m_entityId", m_entityId);
	ser.Value("m_scanned", m_scanned);
	ser.Value("m_overrideIconType", m_overrideIconType);
	ser.Value("m_tagged", m_tagged);
	ser.Value("m_visible", m_visible);
	ser.Value("m_pinged", m_pinged);
}
开发者ID:PiratesAhoy,项目名称:HeartsOfOak-Core,代码行数:9,代码来源:TacticalManager.cpp


示例14: Serialize

//------------------------------------------------------------------------
void CVehicleSeatActionSound::Serialize(TSerialize ser, EEntityAspects aspects)
{
	if (aspects&CVehicle::ASPECT_SEAT_ACTION)
	{
		NET_PROFILE_SCOPE("SeatAction_Sound", ser.IsReading());

		bool enabled=m_enabled;
		
		ser.Value("enabled", enabled, 'bool');

		if(ser.IsReading())
		{
			if(m_enabled != enabled)
			{
				if (enabled)
					ExecuteTrigger(m_nAudioControlIDStart);
				else
					StopTrigger();

				m_enabled=enabled;
			}
		}
	}
}
开发者ID:NightOwlsEntertainment,项目名称:PetBox_A_Journey_to_Conquer_Elementary_Algebra,代码行数:25,代码来源:VehicleSeatActionSound.cpp


示例15: SerializeWith

void SDeclareExplosiveObjectState::SerializeWith( TSerialize ser )
{
	LOGBREAK("SDeclareExplosiveObjectState: %s", ser.IsReading() ? "Reading:" : "Writing");

	ser.Value("breakId", breakId, 'brId');
	ser.Value("isEnt", isEnt);
	if (isEnt)
	{
		if (ser.IsWriting())
			CRY_ASSERT(CCryAction::GetCryAction()->GetGameContext()->GetNetContext()->IsBound(entId));
		ser.Value("entid", entId, 'eid');
		ser.Value("entpos", entPos);
		ser.Value("entrot", entRot);
		ser.Value("entscale", entScale);
	}
	else
	{
		ser.Value("eventPos", eventPos);
		ser.Value("hash", hash);
	}
}
开发者ID:NightOwlsEntertainment,项目名称:PetBox_A_Journey_to_Conquer_Elementary_Algebra,代码行数:21,代码来源:ExplosiveObjectState.cpp


示例16: SerializeSpawnInfo

//------------------------------------------------------------------------
void CProjectile::SerializeSpawnInfo( TSerialize ser )
{
	ser.Value("hostId", m_hostId, 'eid');
	ser.Value("ownerId", m_ownerId, 'eid');
	ser.Value("weaponId", m_weaponId, 'eid');
	ser.Value("fmId", m_fmId, 'fmod');
	ser.Value("pos", m_initial_pos, 'wrld');
	ser.Value("dir", m_initial_dir, 'dir0');
	ser.Value("vel", m_initial_vel, 'vel0');
	ser.Value("tracked", m_tracked, 'bool');

	if (ser.IsReading())
		SetParams(m_ownerId, m_hostId, m_weaponId, m_fmId, m_damage, m_hitTypeId);
}
开发者ID:mrwonko,项目名称:CrysisVR,代码行数:15,代码来源:Projectile.cpp


示例17: Serialize

void CAICounter_Alertness::Serialize( TSerialize ser )
{
	ser.BeginGroup("AICounter_Alertness");

	ser.Value( "m_timeNextUpdate", m_timeNextUpdate );
	ser.Value( "m_alertnessGlobal", m_alertnessGlobal );
	ser.Value( "m_alertnessEnemies", m_alertnessEnemies );
	ser.Value( "m_alertnessFriends", m_alertnessFriends );
	ser.Value( "m_alertnessFaction", m_alertnessFaction );
	ser.Value( "m_bNewListeners", m_bNewListeners );
	if (ser.IsReading())
	{
		m_bJustUpdated = false;
		m_bFactionVectorsAreValid = false;
	}

	ser.EndGroup();
}
开发者ID:Kufusonic,项目名称:Work-in-Progress-Sonic-Fangame,代码行数:18,代码来源:AICounters.cpp


示例18: Serialize

 void Serialize(SActivationInfo *, TSerialize ser)
 {
     ser.BeginGroup("Local");
     ser.Value("m_currentRotation", m_currentRotation);
     ser.Value("m_destinationRotation", m_destinationRotation);
     ser.Value("m_currentRotationStep", m_currentRotationStep);
     ser.Value("m_lastTime", m_lastTime);
     ser.Value("m_timeRemaining", m_timeRemaining);
     // the regular update is taken care of by the FlowGraph itself
     ser.EndGroup();
 }
开发者ID:NightOwlsEntertainment,项目名称:PetBox_A_Journey_to_Conquer_Elementary_Algebra,代码行数:11,代码来源:AngularInterpolatorNode.cpp


示例19: SerializeSpawnInfo

//------------------------------------------------------------------------
void CProjectile::SerializeSpawnInfo(TSerialize ser)
{
	ser.Value("hostId", m_hostId, 'eid');
	ser.Value("ownerId", m_ownerId, 'eid');
	ser.Value("weaponId", m_weaponId, 'eid');
	ser.Value("pos", m_initial_pos, 'wrld');
	ser.Value("dir", m_initial_dir, 'dir0');
	ser.Value("vel", m_initial_vel, 'vel0');

	if(ser.IsReading())
		SetParams(m_ownerId, m_hostId, m_weaponId, m_damage, m_hitTypeId, m_damageDropPerMeter, m_damageDropMinDisSqr);
}
开发者ID:Hellraiser666,项目名称:CryGame,代码行数:13,代码来源:Projectile.cpp


示例20: Serialize

//------------------------------------------------------------------------
void CVehicleActionAutomaticDoor::Serialize(TSerialize ser, EEntityAspects aspects)
{
    ser.Value("timeInTheAir", m_timeInTheAir);
    ser.Value("timeOnTheGround", m_timeOnTheGround);
    ser.Value("isTouchingGround", m_isTouchingGround);
    ser.Value("isTouchingGroundBase", m_isTouchingGroundBase);
    ser.Value("eventSamplingTime",m_eventSamplingTime);

    ser.Value("animTime", m_animTime);

    if (ser.IsReading())
        {
            m_pDoorAnim->StartAnimation();
            m_pDoorAnim->ToggleManualUpdate(true);
            m_pDoorAnim->SetTime(m_animTime);
        }
}
开发者ID:eBunny,项目名称:EmberProject,代码行数:18,代码来源:VehicleActionAutomaticDoor.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ TServiceId类代码示例发布时间:2022-05-31
下一篇:
C++ TSecurityInfo类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap