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

C++ creg::ISerializer类代码示例

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

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



在下文中一共展示了ISerializer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
			}
		}
	}
}
开发者ID:eXLabT,项目名称:spring,代码行数:31,代码来源:InMapDraw.cpp


示例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));
	}
}
开发者ID:eXLabT,项目名称:spring,代码行数:7,代码来源:PieceProjectile.cpp


示例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;
			}
		}
	}
}
开发者ID:genxinzou,项目名称:svn-spring-archive,代码行数:30,代码来源:InMapDraw.cpp


示例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));
	}
}
开发者ID:Mocahteam,项目名称:SpringPP,代码行数:8,代码来源:StarburstProjectile.cpp


示例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);
	}
}
开发者ID:genxinzou,项目名称:svn-spring-archive,代码行数:8,代码来源:LosHandler.cpp


示例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);
}
开发者ID:genxinzou,项目名称:svn-spring-archive,代码行数:10,代码来源:LoadSaveHandler.cpp


示例7: Serialize

void spring_time::Serialize(creg::ISerializer& s)
{
    if (s.IsWriting()) {
        int y = spring_tomsecs(*this - spring_gettime());
        s.SerializeInt(&y, 4);
    } else {
        int y;
        s.SerializeInt(&y, 4);
        *this = *this + spring_msecs(y);
    }
}
开发者ID:jamerlan,项目名称:spring,代码行数:11,代码来源:SpringTime.cpp


示例8: Serialize

void CQuadField::Serialize(creg::ISerializer& s)
{
	// no need to alloc quad array, this has already been done in constructor
	for (int z = 0; z < numQuadsZ; ++z)
		for (int x = 0; x < numQuadsX; ++x)
			s.SerializeObjectInstance(&baseQuads[z*numQuadsX+x], Quad::StaticClass());
}
开发者ID:achoum,项目名称:spring,代码行数:7,代码来源:QuadField.cpp


示例9: 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));
    }
}
开发者ID:Tsuful,项目名称:spring,代码行数:7,代码来源:StarburstProjectile.cpp


示例10: 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);
}
开发者ID:genxinzou,项目名称:svn-spring-archive,代码行数:16,代码来源:RadarHandler.cpp


示例11: creg_Serialize

void CMuzzleFlame::creg_Serialize(creg::ISerializer& s)
{
	s.Serialize(randSmokeDir, numSmoke*sizeof(float3));
}
开发者ID:genxinzou,项目名称:svn-spring-archive,代码行数:4,代码来源:MuzzleFlame.cpp


示例12: Serialize

void CGameStateCollector::Serialize(creg::ISerializer& s)
{
	// GetClass() works because readmap and uh both have to exist already
	s.SerializeObjectInstance(gs, gs->GetClass());
	s.SerializeObjectInstance(gu, gu->GetClass());
	s.SerializeObjectInstance(game, game->GetClass());
	s.SerializeObjectInstance(readmap, readmap->GetClass());
	s.SerializeObjectInstance(qf, qf->GetClass());
	s.SerializeObjectInstance(featureHandler, featureHandler->GetClass());
	s.SerializeObjectInstance(loshandler, loshandler->GetClass());
	s.SerializeObjectInstance(radarhandler, radarhandler->GetClass());
	s.SerializeObjectInstance(airBaseHandler, airBaseHandler->GetClass());
	s.SerializeObjectInstance(&interceptHandler, interceptHandler.GetClass());
	s.SerializeObjectInstance(CCategoryHandler::Instance(), CCategoryHandler::Instance()->GetClass());
	s.SerializeObjectInstance(uh, uh->GetClass());
	s.SerializeObjectInstance(ph, ph->GetClass());
//	std::map<std::string, int> unitRestrictions;
	s.SerializeObjectInstance(&waitCommandsAI, waitCommandsAI.GetClass());
	s.SerializeObjectInstance(&wind, wind.GetClass());
	s.SerializeObjectInstance(inMapDrawer,inMapDrawer->GetClass());
	for (int a=0;a<MAX_TEAMS;a++)
		s.SerializeObjectInstance(grouphandlers[a], grouphandlers[a]->GetClass());
	s.SerializeObjectInstance(globalAI, globalAI->GetClass());
	s.SerializeObjectInstance(&CBuilderCAI::reclaimers,CBuilderCAI::reclaimers.GetClass());
//	s.Serialize()
}
开发者ID:genxinzou,项目名称:svn-spring-archive,代码行数:26,代码来源:LoadSaveHandler.cpp


示例13: Serialize

void CGameStateCollector::Serialize(creg::ISerializer& s)
{
    // GetClass() works because readmap and uh both have to exist already
    s.SerializeObjectInstance(gs, gs->GetClass());
    s.SerializeObjectInstance(gu, gu->GetClass());
    s.SerializeObjectInstance(game, game->GetClass());
    s.SerializeObjectInstance(readmap, readmap->GetClass());
    s.SerializeObjectInstance(qf, qf->GetClass());
    s.SerializeObjectInstance(featureHandler, featureHandler->GetClass());
    s.SerializeObjectInstance(loshandler, loshandler->GetClass());
    s.SerializeObjectInstance(radarhandler, radarhandler->GetClass());
    s.SerializeObjectInstance(airBaseHandler, airBaseHandler->GetClass());
    s.SerializeObjectInstance(&interceptHandler, interceptHandler.GetClass());
    s.SerializeObjectInstance(CCategoryHandler::Instance(), CCategoryHandler::Instance()->GetClass());
    s.SerializeObjectInstance(uh, uh->GetClass());
    s.SerializeObjectInstance(ph, ph->GetClass());
//	std::map<std::string, int> unitRestrictions;
    s.SerializeObjectInstance(&waitCommandsAI, waitCommandsAI.GetClass());
    s.SerializeObjectInstance(&wind, wind.GetClass());
    s.SerializeObjectInstance(inMapDrawerModel, inMapDrawerModel->GetClass());
    for (int a=0; a < teamHandler->ActiveTeams(); a++) {
        s.SerializeObjectInstance(grouphandlers[a], grouphandlers[a]->GetClass());
    }
    s.SerializeObjectInstance(eoh, eoh->GetClass());
//	s.Serialize()
}
开发者ID:spring-multiverse,项目名称:spring,代码行数:26,代码来源:CregLoadSaveHandler.cpp


示例14: sizeof

void springLegacyAI::DamageArray::creg_Serialize(creg::ISerializer& s)
{
	s.Serialize(damages, numTypes * sizeof(damages[0]));
}
开发者ID:304471720,项目名称:spring,代码行数:4,代码来源:DamageArray.cpp


示例15: creg_Serialize

void DamageArray::creg_Serialize(creg::ISerializer& s)
{
	s.Serialize(damages, numTypes * sizeof(damages[0]));
}
开发者ID:BrainDamage,项目名称:spring,代码行数:4,代码来源:DamageArray.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ cryptonote::Currency类代码示例发布时间:2022-05-31
下一篇:
C++ credisclient::VecString类代码示例发布时间: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