本文整理汇总了C++中creg::ISerializer::Serialize方法的典型用法代码示例。如果您正苦于以下问题:C++ ISerializer::Serialize方法的具体用法?C++ ISerializer::Serialize怎么用?C++ ISerializer::Serialize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类creg::ISerializer
的用法示例。
在下文中一共展示了ISerializer::Serialize方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SerializeColor
void SerializeColor(creg::ISerializer &s, unsigned char **color)
{
if (s.IsWriting()) {
char ColorType = 0;
char ColorId = 0;
if (!ColorType)
for (int a = 0; a < teamHandler->ActiveTeams(); ++a)
if (*color==teamHandler->Team(a)->color) {
ColorType = 1;
ColorId = a;
break;
}
s.Serialize(&ColorId,sizeof(ColorId));
s.Serialize(&ColorType,sizeof(ColorType));
} else {
char ColorType;
char ColorId;
s.Serialize(&ColorId,sizeof(ColorId));
s.Serialize(&ColorType,sizeof(ColorType));
switch (ColorType) {
case 0:{
*color = DefaultColor;
break;
}
case 1:{
*color = teamHandler->Team(ColorId)->color;
break;
}
}
}
}
示例2: creg_Serialize
void CPieceProjectile::creg_Serialize(creg::ISerializer& s)
{
s.Serialize(numCallback, sizeof(int));
for (int i = 0; i < 8; i++) {
s.Serialize(oldInfos[i], sizeof(CPieceProjectile::OldInfo));
}
}
示例3: SerializeColor
void SerializeColor(creg::ISerializer &s, unsigned char **color)
{
if (s.IsWriting()) {
char ColorType = 0;
char ColorId = 0;
if (!ColorType) for (int a=0;a<MAX_TEAMS;a++)
if (*color==gs->Team(a)->color) {
ColorType = 1;
ColorId = a;
break;
}
s.Serialize(&ColorId,sizeof(ColorId));
s.Serialize(&ColorType,sizeof(ColorType));
} else {
char ColorType;
char ColorId;
s.Serialize(&ColorId,sizeof(ColorId));
s.Serialize(&ColorType,sizeof(ColorType));
switch (ColorType) {
case 0:{
*color = DefaultColor;
break;
}
case 1:{
*color = gs->Team(ColorId)->color;
break;
}
}
}
}
示例4: creg_Serialize
void CStarburstProjectile::creg_Serialize(creg::ISerializer& s)
{
s.Serialize(numCallback, sizeof(int));
// NOTE This could be tricky if gs is serialized after losHandler.
for (int a = 0; a < 5; ++a) {
s.Serialize(oldInfos[a],sizeof(struct CStarburstProjectile::OldInfo));
}
}
示例5: creg_Serialize
void CLosHandler::creg_Serialize(creg::ISerializer& s)
{
// NOTE This could be tricky if gs is serialized after losHandler.
for (int a = 0; a < gs->activeAllyTeams; ++a) {
s.Serialize(losMap[a], losSizeX*losSizeY*2);
s.Serialize(airLosMap[a], airSizeX*airSizeY*2);
}
}
示例6: SerializeString
static void SerializeString(creg::ISerializer& s, std::string& str)
{
unsigned short size = (unsigned short)str.length();
s.Serialize(&size,2);
if (!s.IsWriting())
str.resize(size);
s.Serialize(&str[0], size);
}
示例7: creg_Serialize
void CStarburstProjectile::creg_Serialize(creg::ISerializer& s)
{
// NOTE This could be tricky if gs is serialized after losHandler.
for (int a = 0; a < NUM_TRACER_PARTS; ++a) {
s.Serialize(&tracerParts[a], sizeof(struct CStarburstProjectile::TracerPart));
}
}
示例8: creg_Serialize
void CRadarHandler::creg_Serialize(creg::ISerializer& s)
{
const int size = xsize*ysize*2;
// NOTE This could be tricky if gs is serialized after radarHandler.
for(int a = 0; a < gs->activeAllyTeams; ++a) {
s.Serialize(radarMaps[a], size);
if (!circularRadar)
s.Serialize(airRadarMaps[a], size);
s.Serialize(sonarMaps[a], size);
s.Serialize(jammerMaps[a], size);
s.Serialize(seismicMaps[a], size);
}
s.Serialize(commonJammerMap, size);
s.Serialize(commonSonarJammerMap, size);
}
示例9: creg_Serialize
void CMuzzleFlame::creg_Serialize(creg::ISerializer& s)
{
s.Serialize(randSmokeDir, numSmoke*sizeof(float3));
}
示例10: sizeof
void springLegacyAI::DamageArray::creg_Serialize(creg::ISerializer& s)
{
s.Serialize(damages, numTypes * sizeof(damages[0]));
}
示例11: creg_Serialize
void DamageArray::creg_Serialize(creg::ISerializer& s)
{
s.Serialize(damages, numTypes * sizeof(damages[0]));
}