本文整理汇总了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);
}
}
}
示例2: Serialize
//------------------------------------------------------------------------
void CPlant::Serialize(TSerialize ser)
{
if (ser.GetSerializationTarget()!=eST_Network)
{
ser.Value("projectiles", m_projectiles);
}
}
示例3: FullSerialize
//----------------------------------------------------------------------
void CVehicleMountedWeapon::FullSerialize(TSerialize ser)
{
CHeavyMountedWeapon::FullSerialize(ser);
ser.BeginGroup("VehicleMountedWeapon");
ser.Value("vehicleId", m_vehicleId);
ser.EndGroup();
}
示例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);
}
}
示例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;
}
示例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;
}
示例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);
}
}
示例8: Serialize
//------------------------------------------------------------------------
void CVehicleDamageBehaviorExplosion::Serialize(TSerialize ser, EEntityAspects aspects)
{
if (ser.GetSerializationTarget() != eST_Network)
{
ser.Value("exploded", m_exploded);
}
}
示例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;
}
示例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();
}
}
}
}
示例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);
}
};
示例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();
}
}
示例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;
}
示例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 );
}
示例15: Serialize
void Serialize(SActivationInfo *, TSerialize ser)
{
ser.Value("m_listening", m_listening);
if(ser.IsReading())
{
g_pGame->GetUI()->RegisterControlSchemeListener(this);
}
}