当前位置: 首页>>代码示例>>C++>>正文


C++ Writer::WrSection方法代码示例

本文整理汇总了C++中serializer::Writer::WrSection方法的典型用法代码示例。如果您正苦于以下问题:C++ Writer::WrSection方法的具体用法?C++ Writer::WrSection怎么用?C++ Writer::WrSection使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在serializer::Writer的用法示例。


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

示例1: Serialize

void Body::Serialize(Serializer::Writer &_wr, Space *space)
{
	Serializer::Writer wr;
	wr.Int32(int(GetType()));
	switch (GetType()) {
		case Object::STAR:
		case Object::PLANET:
		case Object::SPACESTATION:
		case Object::SHIP:
		case Object::PLAYER:
		case Object::MISSILE:
		case Object::CARGOBODY:
		case Object::PROJECTILE:
		case Object::HYPERSPACECLOUD:
			Save(wr, space);
			break;
		default:
			assert(0);
	}
	wr.Vector3d(GetPosition());
	matrix4x4d m;
	GetRotMatrix(m);
	for (int i=0; i<16; i++) wr.Double(m[i]);
	_wr.WrSection("Body", wr.GetData());
}
开发者ID:AaronSenese,项目名称:pioneer,代码行数:25,代码来源:Body.cpp

示例2: Serialize

void Pi::Serialize(Serializer::Writer &wr)
{
	Serializer::Writer section;

	Serializer::IndexFrames();
	Serializer::IndexBodies();
	Serializer::IndexSystemBodies(currentSystem);

	section = Serializer::Writer();
	section.Double(gameTime);
	StarSystem::Serialize(section, selectedSystem);
	StarSystem::Serialize(section, currentSystem);
	wr.WrSection("PiMisc", section.GetData());
	
	section = Serializer::Writer();
	Space::Serialize(section);
	wr.WrSection("Space", section.GetData());

	section = Serializer::Writer();
	Polit::Serialize(section);
	wr.WrSection("Polit", section.GetData());
	
	section = Serializer::Writer();
	sectorView->Save(section);
	wr.WrSection("SectorView", section.GetData());

	section = Serializer::Writer();
	worldView->Save(section);
	wr.WrSection("WorldView", section.GetData());

	section = Serializer::Writer();
	PiLuaModules::Serialize(section);
	wr.WrSection("LuaModules", section.GetData());
}
开发者ID:Snaar,项目名称:pioneer,代码行数:34,代码来源:Pi.cpp

示例3: Serialize

void Space::Serialize(Serializer::Writer &wr)
{
    RebuildFrameIndex();
    RebuildBodyIndex();
    RebuildSystemBodyIndex();

    StarSystem::Serialize(wr, m_starSystem.Get());

    Serializer::Writer section;
    Frame::Serialize(section, m_rootFrame.Get(), this);
    wr.WrSection("Frames", section.GetData());

    wr.Int32(m_bodies.size());
    for (BodyIterator i = m_bodies.begin(); i != m_bodies.end(); ++i)
        (*i)->Serialize(wr, this);
}
开发者ID:adammead,项目名称:pioneer,代码行数:16,代码来源:Space.cpp

示例4: Serialize

void Space::Serialize(Serializer::Writer &wr)
{
	RebuildFrameIndex();
	RebuildBodyIndex();
	RebuildSystemBodyIndex();

	StarSystem::Serialize(wr, m_starSystem.Get());

	Serializer::Writer section;
	Frame::Serialize(section, m_rootFrame.get(), this);
	wr.WrSection("Frames", section.GetData());

	wr.Int32(m_bodies.size());
	for (Body* b : m_bodies)
		b->Serialize(wr, this);
}
开发者ID:ZeframCochrane,项目名称:pioneer,代码行数:16,代码来源:Space.cpp

示例5: Serialize

void Body::Serialize(Serializer::Writer &_wr, Space *space)
{
	Serializer::Writer wr;
	wr.Int32(int(GetType()));
	switch (GetType()) {
		case Object::STAR:
		case Object::PLANET:
		case Object::SPACESTATION:
		case Object::SHIP:
		case Object::PLAYER:
		case Object::MISSILE:
		case Object::CARGOBODY:
		case Object::PROJECTILE:
		case Object::HYPERSPACECLOUD:
			Save(wr, space);
			break;
		default:
			assert(0);
	}
	_wr.WrSection("Body", wr.GetData());
}
开发者ID:MeteoricGames,项目名称:pioneer,代码行数:21,代码来源:Body.cpp

示例6: Serialize

void Game::Serialize(Serializer::Writer &wr)
{
	// leading signature
	for (Uint32 i = 0; i < strlen(s_saveStart)+1; i++)
		wr.Byte(s_saveStart[i]);

	// version
	wr.Int32(s_saveVersion);

	Serializer::Writer section;

	// game state
	section.Double(m_time);
	section.Int32(Uint32(m_state));

	section.Bool(m_wantHyperspace);
	section.Double(m_hyperspaceProgress);
	section.Double(m_hyperspaceDuration);
	section.Double(m_hyperspaceEndTime);

	wr.WrSection("Game", section.GetData());


	// space, all the bodies and things
	section = Serializer::Writer();
	m_space->Serialize(section);
	section.Int32(m_space->GetIndexForBody(m_player.get()));
	wr.WrSection("Space", section.GetData());


	// space transition state
	section = Serializer::Writer();

	// hyperspace clouds being brought over from the previous system
	section.Int32(m_hyperspaceClouds.size());
	for (std::list<HyperspaceCloud*>::const_iterator i = m_hyperspaceClouds.begin(); i != m_hyperspaceClouds.end(); ++i)
		(*i)->Serialize(section, m_space.get());

	wr.WrSection("HyperspaceClouds", section.GetData());


	// system political data (crime etc)
	section = Serializer::Writer();
	Polit::Serialize(section);
	wr.WrSection("Polit", section.GetData());


	// views. must be saved in init order
	section = Serializer::Writer();
	Pi::cpan->Save(section);
	wr.WrSection("ShipCpanel", section.GetData());

	section = Serializer::Writer();
	Pi::sectorView->Save(section);
	wr.WrSection("SectorView", section.GetData());

	section = Serializer::Writer();
	Pi::worldView->Save(section);
	wr.WrSection("WorldView", section.GetData());


	// lua
	section = Serializer::Writer();
	Pi::luaSerializer->Serialize(section);
	wr.WrSection("LuaModules", section.GetData());


	// trailing signature
	for (Uint32 i = 0; i < strlen(s_saveEnd)+1; i++)
		wr.Byte(s_saveEnd[i]);
}
开发者ID:jfabrix,项目名称:pioneer,代码行数:71,代码来源:Game.cpp


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