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


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

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


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

示例1: Save

void Player::Save(Serializer::Writer &wr, Space *space)
{
	Ship::Save(wr, space);
	MarketAgent::Save(wr);
	wr.Int32(m_killCount);
	wr.Int32(m_knownKillCount);
}
开发者ID:GizmoR13,项目名称:pioneer,代码行数:7,代码来源:Player.cpp

示例2: Save

void SpaceStation::Save(Serializer::Writer &wr, Space *space)
{
	ModelBody::Save(wr, space);
	wr.Int32(Equip::TYPE_MAX);
	wr.Int32(m_shipDocking.size());
	for (Uint32 i=0; i<m_shipDocking.size(); i++) {
		wr.Int32(space->GetIndexForBody(m_shipDocking[i].ship));
		wr.Int32(m_shipDocking[i].stage);
		wr.Float(float(m_shipDocking[i].stagePos));
		wr.Vector3d(m_shipDocking[i].fromPos);
		wr.WrQuaternionf(m_shipDocking[i].fromRot);
	}
	// store each of the bay groupings
	wr.Int32(mBayGroups.size());
	for (Uint32 i=0; i<mBayGroups.size(); i++) {
		wr.Int32(mBayGroups[i].minShipSize);
		wr.Int32(mBayGroups[i].maxShipSize);
		wr.Bool(mBayGroups[i].inUse);
		wr.Int32(mBayGroups[i].bayIDs.size());
		for (Uint32 j=0; j<mBayGroups[i].bayIDs.size(); j++) {
			wr.Int32(mBayGroups[i].bayIDs[j]);
		}
	}

	wr.Int32(space->GetIndexForSystemBody(m_sbody));
	wr.Int32(m_numPoliceDocked);

	wr.Double(m_doorAnimationStep);
	wr.Double(m_doorAnimationState);

	m_navLights->Save(wr);
}
开发者ID:AmesianX,项目名称:pioneer,代码行数:32,代码来源:SpaceStation.cpp

示例3: Save

void Missile::Save(Serializer::Writer &wr, Space *space)
{
	Ship::Save(wr, space);
	wr.Int32(space->GetIndexForBody(m_owner));
	wr.Int32(m_power);
	wr.Bool(m_armed);
}
开发者ID:lwho,项目名称:pioneer,代码行数:7,代码来源:Missile.cpp

示例4: SaveAnimations

void BinaryConverter::SaveAnimations(Serializer::Writer &wr, Model *m)
{
	const auto& anims = m->GetAnimations();
	wr.Int32(anims.size());
	for (const auto& anim : anims) {
		wr.String(anim->GetName());
		wr.Double(anim->GetDuration());
		wr.Int32(anim->GetChannels().size());
		for (const auto &chan : anim->GetChannels()) {
			wr.String(chan.node->GetName());
			//write pos/rot/scale keys
			wr.Int32(chan.positionKeys.size());
			for (const auto &pkey : chan.positionKeys) {
				wr.Double(pkey.time);
				wr.Vector3f(pkey.position);
			}
			wr.Int32(chan.rotationKeys.size());
			for (const auto &rkey : chan.rotationKeys) {
				wr.Double(rkey.time);
				wr.WrQuaternionf(rkey.rotation);
			}
			wr.Int32(chan.scaleKeys.size());
			for (const auto &skey : chan.scaleKeys) {
				wr.Double(skey.time);
				wr.Vector3f(skey.scale);
			}
		}
	}
}
开发者ID:Ash-Bash,项目名称:pioneer-horizons,代码行数:29,代码来源:BinaryConverter.cpp

示例5: Save

void GeomTree::Save(Serializer::Writer &wr) const
{
	wr.Int32(m_numVertices);
	wr.Int32(m_numEdges);
	wr.Int32(m_numTris);
	wr.Double(m_radius);

	wr.Vector3d(m_aabb.max);
	wr.Vector3d(m_aabb.min);
	wr.Double(m_aabb.radius);

	wr.Int32(m_numEdges);
	for (Sint32 iAabb = 0; iAabb < m_numEdges; ++iAabb) {
		wr.Vector3d(m_aabbs[iAabb].max);
		wr.Vector3d(m_aabbs[iAabb].min);
		wr.Double(m_aabbs[iAabb].radius);
	}

	for (Sint32 iEdge = 0; iEdge < m_numEdges; ++iEdge) {
		m_edges[iEdge].Save(wr);
	}

	for (Sint32 iVert = 0; iVert < m_numVertices; ++iVert) {
		wr.Vector3f(m_vertices[iVert]);
	}

	for (Sint32 iIndi = 0; iIndi < (m_numTris * 3); ++iIndi) {
		wr.Int16(m_indices[iIndi]);
	}

	for (Sint32 iTri = 0; iTri < m_numTris; ++iTri) {
		wr.Int32(m_triFlags[iTri]);
	}
}
开发者ID:RevReese,项目名称:pioneer-sp,代码行数:34,代码来源:GeomTree.cpp

示例6: Save

void Player::Save(Serializer::Writer &wr)
{
	Ship::Save(wr);
	wr.Int32(static_cast<int>(m_flightControlState));
	wr.Double(m_setSpeed);
	wr.Int32(m_killCount);
	wr.Int32(m_knownKillCount);
}
开发者ID:Snaar,项目名称:pioneer,代码行数:8,代码来源:Player.cpp

示例7: Save

void Missile::Save(Serializer::Writer &wr)
{
	Ship::Save(wr);
	wr.Int32(Serializer::LookupBody(m_owner));
	wr.Int32(Serializer::LookupBody(m_target));
	wr.Double(m_distToTarget);
	wr.Int32(m_power);
}
开发者ID:unavowed,项目名称:pioneer,代码行数:8,代码来源:Missile.cpp

示例8: Save

void Missile::Save(Serializer::Writer &wr, Space *space)
{
	Ship::Save(wr, space);
	wr.Int32(space->GetIndexForBody(m_owner));
	wr.Int32(space->GetIndexForBody(m_target));
	wr.Double(m_distToTarget);
	wr.Int32(m_power);
}
开发者ID:AaronSenese,项目名称:pioneer,代码行数:8,代码来源:Missile.cpp

示例9: Save

void AICommand::Save(Serializer::Writer &wr)
{
	Space *space = Pi::game->GetSpace();
	wr.Int32(m_cmdName);
	wr.Int32(space->GetIndexForBody(m_ship));
	if (m_child) m_child->Save(wr);
	else wr.Int32(CMD_NONE);
}
开发者ID:gamebytes,项目名称:pioneer,代码行数:8,代码来源:ShipAICmd.cpp

示例10: Save

void PlayerShipController::Save(Serializer::Writer &wr, Space *space)
{
	wr.Int32(static_cast<int>(m_flightControlState));
	wr.Double(m_setSpeed);
	wr.Float(m_lowThrustPower);
	wr.Int32(space->GetIndexForBody(m_combatTarget));
	wr.Int32(space->GetIndexForBody(m_navTarget));
	wr.Int32(space->GetIndexForBody(m_setSpeedTarget));
}
开发者ID:NeuralKernel,项目名称:pioneer,代码行数:9,代码来源:ShipController.cpp

示例11: Save

void Projectile::Save(Serializer::Writer &wr, Space *space)
{
	Body::Save(wr, space);
	wr.Vector3d(m_baseVel);
	wr.Vector3d(m_dirVel);
	wr.Float(m_age);
	wr.Int32(m_type);
	wr.Int32(space->GetIndexForBody(m_parent));
}
开发者ID:AmesianX,项目名称:pioneer,代码行数:9,代码来源:Projectile.cpp

示例12: Save

void Projectile::Save(Serializer::Writer &wr, Space *space)
{
	Body::Save(wr, space);
	for (int i=0; i<16; i++) wr.Double(m_orient[i]);
	wr.Vector3d(m_baseVel);
	wr.Vector3d(m_dirVel);
	wr.Float(m_age);
	wr.Int32(m_type);
	wr.Int32(space->GetIndexForBody(m_parent));
}
开发者ID:Thargoid,项目名称:pioneer,代码行数:10,代码来源:Projectile.cpp

示例13: Save

void EquipSet::Save(Serializer::Writer &wr)
{
	wr.Int32(Equip::SLOT_MAX);
	for (int i=0; i<Equip::SLOT_MAX; i++) {
		wr.Int32(equip[i].size());
		for (unsigned int j=0; j<equip[i].size(); j++) {
			wr.Int32(static_cast<int>(equip[i][j]));
		}
	}
}
开发者ID:unavowed,项目名称:pioneer,代码行数:10,代码来源:ShipType.cpp

示例14: Save

void SpaceStation::Save(Serializer::Writer &wr)
{
	ModelBody::Save(wr);
	MarketAgent::Save(wr);
	wr.Int32(Equip::TYPE_MAX);
	for (int i=0; i<Equip::TYPE_MAX; i++) {
		wr.Int32((int)m_equipmentStock[i]);
	}
	// save shipyard
	wr.Int32(m_shipsOnSale.size());
	for (std::vector<ShipFlavour>::iterator i = m_shipsOnSale.begin();
			i != m_shipsOnSale.end(); ++i) {
		(*i).Save(wr);
	}
	// save bb adverts
	wr.Int32(m_bbadverts.size());
	for (std::vector<BBAdvert>::iterator i = m_bbadverts.begin();
			i != m_bbadverts.end(); ++i) {
		(*i).Save(wr);
	}
	for (int i=0; i<MAX_DOCKING_PORTS; i++) {
		wr.Int32(Serializer::LookupBody(m_shipDocking[i].ship));
		wr.Int32(m_shipDocking[i].stage);
		wr.Float((float)m_shipDocking[i].stagePos);
		wr.Vector3d(m_shipDocking[i].fromPos);
		wr.WrQuaternionf(m_shipDocking[i].fromRot);

		wr.Float((float)m_openAnimState[i]);
		wr.Float((float)m_dockAnimState[i]);
	}
	wr.Double(m_lastUpdatedShipyard);
	wr.Int32(Serializer::LookupSystemBody(m_sbody));
	wr.Int32(m_numPoliceDocked);
}
开发者ID:Snaar,项目名称:pioneer,代码行数:34,代码来源:SpaceStation.cpp

示例15: Save

void Ship::Save(Serializer::Writer &wr)
{
	DynamicBody::Save(wr);
	wr.Vector3d(m_angThrusters);
	wr.Vector3d(m_thrusters);
	wr.Int32(m_wheelTransition);
	wr.Float(m_wheelState);
	wr.Float(m_launchLockTimeout);
	wr.Bool(m_testLanded);
	wr.Int32(int(m_flightState));
	wr.Int32(int(m_alertState));
	wr.Float(m_lastFiringAlert);

	m_hyperspace.dest.Serialize(wr);
	wr.Float(m_hyperspace.countdown);

	for (int i=0; i<ShipType::GUNMOUNT_MAX; i++) {
		wr.Int32(m_gunState[i]);
		wr.Float(m_gunRecharge[i]);
		wr.Float(m_gunTemperature[i]);
	}
	wr.Float(m_ecmRecharge);
	m_shipFlavour.Save(wr);
	wr.Int32(m_dockedWithPort);
	wr.Int32(Serializer::LookupBody(m_dockedWith));
	m_equipment.Save(wr);
	wr.Float(m_stats.hull_mass_left);
	wr.Float(m_stats.shield_mass_left);
	if(m_curAICmd) { wr.Int32(1); m_curAICmd->Save(wr); }
	else wr.Int32(0);
}
开发者ID:GAlexx,项目名称:pioneer,代码行数:31,代码来源:Ship.cpp


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