本文整理汇总了C++中TSerialize::BeginGroup方法的典型用法代码示例。如果您正苦于以下问题:C++ TSerialize::BeginGroup方法的具体用法?C++ TSerialize::BeginGroup怎么用?C++ TSerialize::BeginGroup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TSerialize
的用法示例。
在下文中一共展示了TSerialize::BeginGroup方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SerializeArray
void SerializeArray(TSerialize ser, const char* szName, T* vec, uint32 count)
{
ser.BeginGroup(szName);
if (ser.IsWriting())
{
ser.Value("count", count);
for (uint32 i=0; i<count; ++i)
{
ser.BeginGroup("i");
ser.Value("Value", vec[i]);
ser.EndGroup();
}
}
else
{
uint32 storedCount = 0;
ser.Value("count", storedCount);
uint32 toFill = storedCount < count ? storedCount : count;
uint32 i=0;
while (toFill--)
{
ser.BeginGroup("i");
ser.Value("Value", vec[i++]);
ser.EndGroup();
}
}
ser.EndGroup();
}
示例2: Serialize
void CColorGradientManager::Serialize(TSerialize serializer)
{
if(serializer.IsReading())
Reset();
serializer.BeginGroup("ColorGradientManager");
{
int numToLoad = (int)m_colorGradientsToLoad.size();
int numLoaded = (int)m_currentGradients.size();
int numGradients = numToLoad + numLoaded;
serializer.Value("ColorGradientCount", numGradients);
if(serializer.IsWriting())
{
for(int i=0; i<numToLoad; ++i)
{
LoadingColorGradient& gradient = m_colorGradientsToLoad[i];
serializer.BeginGroup("ColorGradient");
serializer.Value("FilePath", gradient.m_filePath);
serializer.Value("FadeInTime", gradient.m_fadeInTimeInSeconds);
serializer.EndGroup();
}
for(int i=0; i<numLoaded; ++i)
{
LoadedColorGradient& gradient = m_currentGradients[i];
serializer.BeginGroup("ColorGradient");
serializer.Value("FilePath", gradient.m_filePath);
serializer.Value("BlendAmount", gradient.m_layer.m_blendAmount);
serializer.Value("FadeInTime", gradient.m_fadeInTimeInSeconds);
serializer.Value("ElapsedTime", gradient.m_elapsedTime);
serializer.Value("MaximumBlendAmount", gradient.m_maximumBlendAmount);
serializer.EndGroup();
}
}
else
{
m_currentGradients.reserve(numGradients);
for(int i=0; i<numGradients; ++i)
{
serializer.BeginGroup("ColorGradient");
string filePath;
float blendAmount = 1.0f;
float fadeInTimeInSeconds = 0.0f;
serializer.Value("FilePath", filePath);
serializer.Value("BlendAmount", blendAmount);
serializer.Value("FadeInTime", fadeInTimeInSeconds);
const int textureID = GetColorGradingController().LoadColorChart(filePath);
LoadedColorGradient gradient(filePath, SColorChartLayer(textureID, blendAmount), fadeInTimeInSeconds);
// Optional
serializer.ValueWithDefault("ElapsedTime", gradient.m_elapsedTime, 0.0f);
serializer.ValueWithDefault("MaximumBlendAmount", gradient.m_maximumBlendAmount, 1.0f);
m_currentGradients.push_back(gradient);
serializer.EndGroup();
}
}
serializer.EndGroup();
}
}
示例3: Serialize
//------------------------------------------------------------------------
void CVehicleDamagesGroup::Serialize(TSerialize ser, EEntityAspects aspects)
{
ser.BeginGroup("SubGroups");
for (TDamagesSubGroupVector::iterator ite = m_damageSubGroups.begin();
ite != m_damageSubGroups.end(); ++ite)
{
ser.BeginGroup("SubGroup");
SDamagesSubGroup& subGroup = *ite;
TVehicleDamageBehaviorVector& damageBehaviors = subGroup.m_damageBehaviors;
for (TVehicleDamageBehaviorVector::iterator behaviorIte = damageBehaviors.begin(); behaviorIte != damageBehaviors.end(); ++behaviorIte)
{
IVehicleDamageBehavior* pBehavior = *behaviorIte;
ser.BeginGroup("Behavior");
pBehavior->Serialize(ser, aspects);
ser.EndGroup();
}
ser.EndGroup();
}
ser.EndGroup();
int size = m_delayedSubGroups.size();
ser.Value("DelayedSubGroupEntries", size);
if(ser.IsWriting())
{
for (TDelayedDamagesSubGroupList::iterator ite = m_delayedSubGroups.begin(); ite != m_delayedSubGroups.end(); ++ite)
{
ser.BeginGroup("SubGroup");
SDelayedDamagesSubGroupInfo& delayedInfo = *ite;
ser.Value("delayedInfoId", delayedInfo.subGroupId);
ser.Value("delayedInfoDelay", delayedInfo.delay);
delayedInfo.behaviorParams.Serialize(ser, m_pVehicle);
ser.EndGroup();
}
}
else if(ser.IsReading())
{
m_delayedSubGroups.clear();
for(int i = 0; i < size; ++i)
{
ser.BeginGroup("SubGroup");
SDelayedDamagesSubGroupInfo delayInfo;
ser.Value("delayedInfoId", delayInfo.subGroupId);
ser.Value("delayedInfoDelay", delayInfo.delay);
delayInfo.behaviorParams.Serialize(ser, m_pVehicle);
ser.EndGroup();
}
}
}
示例4:
void CSPAnalyst::PlayerAnalysis::Serialize(TSerialize ser)
{
ser.BeginGroup("PA");
ser.Value("kills", kills);
ser.Value("deaths", deaths);
ser.EndGroup();
}
示例5: 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);
}
}
示例6: SerializeTable
void CScriptProxy::SerializeTable( TSerialize ser, const char* name )
{
CHECK_SCRIPT_STACK;
SmartScriptTable table;
if (ser.IsReading())
{
if (ser.BeginOptionalGroup(name,true))
{
table = SmartScriptTable(m_pThis->GetScriptSystem());
ser.Value( "table", table );
m_pThis->SetValue(name, table);
ser.EndGroup();
}
}
else
{
if (m_pThis->GetValue(name, table))
{
ser.BeginGroup(name);
ser.Value( "table", table );
ser.EndGroup();
}
}
}
示例7: Serialize
virtual void Serialize(SActivationInfo *, TSerialize ser)
{
ser.BeginGroup("Local");
ser.Value("lastTickTime", m_lastTickTime );
ser.Value("count", m_count );
ser.EndGroup();
}
开发者ID:NightOwlsEntertainment,项目名称:PetBox_A_Journey_to_Conquer_Elementary_Algebra,代码行数:7,代码来源:FlowTimeNode.cpp
示例8: FullSerialize
//----------------------------------------------------------------------
void CVehicleMountedWeapon::FullSerialize(TSerialize ser)
{
CHeavyMountedWeapon::FullSerialize(ser);
ser.BeginGroup("VehicleMountedWeapon");
ser.Value("vehicleId", m_vehicleId);
ser.EndGroup();
}
示例9: Serialize
virtual void Serialize(SActivationInfo *pActInfo, TSerialize ser)
{
ser.BeginGroup("Local");
ser.Value("m_entityId", m_entityId);
ser.Value("m_delayResult", m_delayResult);
if (ser.IsReading())
{
bool bEnabled = false;
ser.Value("m_enabled", bEnabled);
if(bEnabled)
{
m_actInfo = *pActInfo;
}
SetEnabled(bEnabled); // can't hurt to do this on load as the listener uses stl::push_back_unique
}
else
{
ser.Value("m_enabled", m_enabled);
}
ser.EndGroup();
}
示例10: Serialize
virtual void Serialize(SActivationInfo *pActInfo, TSerialize ser)
{
ser.BeginGroup("Local");
ser.Value("m_triggered", m_triggered);
int64 time;
time = m_startTime.GetValue();
ser.Value("m_startTime", time);
if(ser.IsReading()) m_startTime.SetValue(time);
time = m_currentTime.GetValue();
ser.Value("m_currentTime", time);
if(ser.IsReading()) m_currentTime.SetValue(time);
if (ser.IsReading())
{
if(m_triggered)
{
m_actInfo = *pActInfo;
pActInfo->pGraph->SetRegularlyUpdated(pActInfo->myID, true);
}
}
ser.EndGroup();
}
示例11: SerializeSaveLevelToLevel
void CGameTokenSystem::SerializeSaveLevelToLevel( const char** ppGameTokensList, uint32 numTokensToSave )
{
{
ScopedSwitchToGlobalHeap globalHeap;
m_levelToLevelSave = gEnv->pSystem->CreateXmlNode( "GameTokensLevelToLevel" );
}
IXmlSerializer* pSerializer = gEnv->pSystem->GetXmlUtils()->CreateXmlSerializer();
ISerialize* pSer = pSerializer->GetWriter(m_levelToLevelSave);
TSerialize ser = TSerialize(pSer);
{
ScopedSwitchToGlobalHeap globalHeap;
uint32 numTokensSaved = 0;
for (uint32 i=0; i<numTokensToSave; ++i)
{
const char* pName = ppGameTokensList[i];
CGameToken* pToken = GetToken( pName );
if (pToken)
{
numTokensSaved++;
ser.BeginGroup("Token");
ser.Value( "name",pToken->m_name );
pToken->m_value.Serialize(ser);
ser.EndGroup();
}
else
CryWarning(VALIDATOR_MODULE_GAME, VALIDATOR_ERROR, "GameTokenSystem. GameToken %s was not found when trying to serialize (save) level to level", pName ? pName : "<NULL>");
}
ser.Value( "numTokens", numTokensSaved );
}
pSerializer->Release();
}
开发者ID:NightOwlsEntertainment,项目名称:PetBox_A_Journey_to_Conquer_Elementary_Algebra,代码行数:33,代码来源:GameTokenSystem.cpp
示例12: SerializeReadLevelToLevel
void CGameTokenSystem::SerializeReadLevelToLevel()
{
if (!m_levelToLevelSave)
return;
IXmlSerializer* pSerializer = gEnv->pSystem->GetXmlUtils()->CreateXmlSerializer();
ISerialize* pSer = pSerializer->GetReader( m_levelToLevelSave );
TSerialize ser = TSerialize(pSer);
{
ScopedSwitchToGlobalHeap globalHeap;
uint32 numTokens = 0;
ser.Value( "numTokens", numTokens );
for (uint32 i=0; i<numTokens; i++)
{
ser.BeginGroup("Token");
string tokenName;
ser.Value( "name", tokenName );
CGameToken* pToken = GetToken( tokenName.c_str() );
if (pToken)
pToken->m_value.Serialize(ser);
else
CryWarning(VALIDATOR_MODULE_GAME, VALIDATOR_ERROR, "GameTokenSystem. GameToken '%s' was not found when trying to serialize (read) level to level", tokenName.c_str() );
ser.EndGroup();
}
}
pSerializer->Release();
m_levelToLevelSave = NULL; // this frees it
}
开发者ID:NightOwlsEntertainment,项目名称:PetBox_A_Journey_to_Conquer_Elementary_Algebra,代码行数:29,代码来源:GameTokenSystem.cpp
示例13: Serialize
void HazardModule::Serialize(TSerialize ser)
{
BaseClass::Serialize(ser);
ser.BeginGroup("HazardModule");
uint32 hazardsAmount = (uint32)m_ProjectileHazards.size();
ser.Value("ProjectileHazardsAmount", hazardsAmount);
m_ProjectileHazards.resize(hazardsAmount);
HazardDataProjectiles::iterator hazardProjectileIter;
HazardDataProjectiles::iterator hazardProjectileEndIter = m_ProjectileHazards.end();
for (hazardProjectileIter = m_ProjectileHazards.begin() ; hazardProjectileIter != hazardProjectileEndIter ;
++hazardProjectileIter)
{
hazardProjectileIter->Serialize(ser);
}
hazardsAmount = (uint32)m_SphereHazards.size();
ser.Value("SphereHazardsAmount", hazardsAmount);
m_SphereHazards.resize(hazardsAmount);
HazardDataSpheres::iterator hazardSphereIter;
HazardDataSpheres::iterator hazardSphereEndIter = m_SphereHazards.end();
for (hazardSphereIter = m_SphereHazards.begin() ; hazardSphereIter != hazardSphereEndIter ;
++hazardSphereIter)
{
hazardSphereIter->Serialize(ser);
}
// Note: m_UpdateLockCount does not need to be serialized because it is only used for
// sanity checks during updates.
ser.Value("InstanceIDGen", m_InstanceIDGen);
ser.EndGroup();
}
示例14: FullSerialize
void CFlyer::FullSerialize(TSerialize ser)
{
CPlayer::FullSerialize(ser);
ser.BeginGroup("CFlyer");
ser.Value("vDesiredVelocity", m_vDesiredVelocity);
ser.Value("qDesiredRotation", m_qDesiredRotation);
ser.EndGroup();
}
示例15: Serialize
void HazardSphere::Serialize(TSerialize ser)
{
ser.BeginGroup("HazardSphere");
ser.Value("CenterPos", m_CenterPos);
ser.Value("Radius", m_Radius);
ser.EndGroup();
}