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


C++ Reader::Double方法代码示例

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


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

示例1: AICommand

AIParagonCmdGoTo::AIParagonCmdGoTo(Serializer::Reader &rd) : AICommand(rd, CMD_PARAGON_GOTO) 
{
	m_targetFrameIndex = rd.Int32();
	m_targetPosition = rd.Vector3d();
	m_toTransit = rd.Bool();

	if(Game::s_loadedGameVersion >= 77) { // Save game upgrade: 76 -> 77
		m_targetOrient = matrix3x3d::FromVectors(
			rd.Vector3d(), rd.Vector3d(), rd.Vector3d());
		m_startPO.pos = rd.Vector3d();
		m_startPO.xaxis = rd.Vector3d();
		m_startPO.yaxis = rd.Vector3d();
		m_startPO.zaxis = rd.Vector3d();

		m_endPO.pos = rd.Vector3d();
		m_endPO.xaxis = rd.Vector3d();
		m_endPO.yaxis = rd.Vector3d();
		m_endPO.zaxis = rd.Vector3d();

		m_speedLimit = rd.Double();
		m_arrivalSpeed = rd.Double();

		m_mode = static_cast<EGoToMode>(rd.Int32());
	}
}
开发者ID:MeteoricGames,项目名称:pioneer,代码行数:25,代码来源:ShipAICmdParagon.cpp

示例2: LoadAnimations

void BinaryConverter::LoadAnimations(Serializer::Reader &rd)
{
	//load channels and PRS keys
	const Uint32 numAnims = rd.Int32();
	for (Uint32 i = 0; i < numAnims; i++) {
		const std::string animName = rd.String();
		const double duration = rd.Double();
		Animation *anim = new Animation(animName, duration);
		const Uint32 numChans = rd.Int32();
		for (Uint32 j = 0; j < numChans; j++) {
			const std::string tgtName = rd.String();
			MatrixTransform* tgtNode = dynamic_cast<MatrixTransform*>(m_model->m_root->FindNode(tgtName));
			anim->m_channels.push_back(AnimationChannel(tgtNode));
			auto& chan = anim->m_channels.back();
			for (Uint32 numKeys = rd.Int32(); numKeys > 0; numKeys--) {
				const double ktime = rd.Double();
				const vector3f kpos = rd.Vector3f();
				chan.positionKeys.push_back(PositionKey(ktime, kpos));
			}
			for (Uint32 numKeys = rd.Int32(); numKeys > 0; numKeys--) {
				const double ktime = rd.Double();
				const Quaternionf krot = rd.RdQuaternionf();
				chan.rotationKeys.push_back(RotationKey(ktime, krot));
			}
			for (Uint32 numKeys = rd.Int32(); numKeys > 0; numKeys--) {
				const double ktime = rd.Double();
				const vector3f kscale = rd.Vector3f();
				chan.scaleKeys.push_back(ScaleKey(ktime, kscale));
			}
		}
		m_model->m_animations.push_back(anim);
	}
}
开发者ID:Ash-Bash,项目名称:pioneer-horizons,代码行数:33,代码来源:BinaryConverter.cpp

示例3: Load

void HyperspaceCloud::Load(Serializer::Reader &rd, Space *space)
{
	Body::Load(rd, space);
	m_vel = rd.Vector3d();
	m_birthdate = rd.Double();
	m_due = rd.Double();
	m_isArrival = rd.Bool();
	if (rd.Bool()) {
		m_ship = static_cast<Ship*>(Body::Unserialize(rd, space));
	}
}
开发者ID:AmesianX,项目名称:pioneer,代码行数:11,代码来源:HyperspaceCloud.cpp

示例4: Load

void Body::Load(Serializer::Reader &rd, Space *space)
{
	m_frame = space->GetFrameByIndex(rd.Int32());
	m_label = rd.String();
	Properties().Set("label", m_label);
	m_dead = rd.Bool();

	m_pos = rd.Vector3d();
	for (int i=0; i<9; i++) m_orient[i] = rd.Double();
	m_physRadius = rd.Double();
	m_clipRadius = rd.Double();
}
开发者ID:MeteoricGames,项目名称:pioneer,代码行数:12,代码来源:Body.cpp

示例5: Load

void DynamicBody::Load(Serializer::Reader &rd, Space *space)
{
    ModelBody::Load(rd, space);
    m_force = rd.Vector3d();
    m_torque = rd.Vector3d();
    m_vel = rd.Vector3d();
    m_angVel = rd.Vector3d();
    m_mass = rd.Double();
    m_massRadius = rd.Double();
    m_angInertia = rd.Double();
    m_isMoving = rd.Bool();
}
开发者ID:dreadk2002,项目名称:pioneer,代码行数:12,代码来源:DynamicBody.cpp

示例6: Load

void Ship::Load(Serializer::Reader &rd, Space *space)
{
	DynamicBody::Load(rd, space);
	// needs fixups
	m_angThrusters = rd.Vector3d();
	m_thrusters = rd.Vector3d();
	m_wheelTransition = rd.Int32();
	m_wheelState = rd.Float();
	m_launchLockTimeout = rd.Float();
	m_testLanded = rd.Bool();
	m_flightState = FlightState(rd.Int32());
	m_alertState = AlertState(rd.Int32());
	m_lastFiringAlert = rd.Double();

	m_hyperspace.dest = SystemPath::Unserialize(rd);
	m_hyperspace.countdown = rd.Float();

	for (int i=0; i<ShipType::GUNMOUNT_MAX; i++) {
		m_gunState[i] = rd.Int32();
		m_gunRecharge[i] = rd.Float();
		m_gunTemperature[i] = rd.Float();
	}
	m_ecmRecharge = rd.Float();
	m_shipFlavour.Load(rd);
	m_type = &ShipType::types[m_shipFlavour.id];
	m_dockedWithPort = rd.Int32();
	m_dockedWithIndex = rd.Int32();
	m_equipment.InitSlotSizes(m_shipFlavour.id);
	m_equipment.Load(rd);
	Init();
	m_stats.hull_mass_left = rd.Float(); // must be after Init()...
	m_stats.shield_mass_left = rd.Float();
	if(rd.Int32()) m_curAICmd = AICommand::Load(rd);
	else m_curAICmd = 0;
	m_aiMessage = AIError(rd.Int32());
	SetFuel(rd.Double());
	m_stats.fuel_tank_mass_left = GetShipType().fuelTankMass * GetFuel();
	m_reserveFuel = rd.Double();
	UpdateStats(); // this is necessary, UpdateStats() in Ship::Init has wrong values of m_thrusterFuel after Load

	m_controller = 0;
	const ShipController::Type ctype = static_cast<ShipController::Type>(rd.Int32());
	if (ctype == ShipController::PLAYER)
		SetController(new PlayerShipController());
	else
		SetController(new ShipController());
	m_controller->Load(rd);

	m_equipment.onChange.connect(sigc::mem_fun(this, &Ship::OnEquipmentChange));
}
开发者ID:HeadHunterEG,项目名称:pioneer,代码行数:50,代码来源:Ship.cpp

示例7: Load

void DynamicBody::Load(Serializer::Reader &rd)
{
	ModelBody::Load(rd);
	for (int i=0; i<16; i++) m_orient[i] = rd.Double();
	m_oldOrient = m_orient;
	m_force = rd.Vector3d();
	m_torque = rd.Vector3d();
	m_vel = rd.Vector3d();
	m_angVel = rd.Vector3d();
	m_mass = rd.Double();
	m_massRadius = rd.Double();
	m_angInertia = rd.Double();
	m_enabled = rd.Bool();
}
开发者ID:dewasha,项目名称:pioneer,代码行数:14,代码来源:DynamicBody.cpp

示例8: Unserialize

void Pi::Unserialize(Serializer::Reader &rd)
{
	Serializer::Reader section;
	
	SetTimeAccel(0);
	requestedTimeAccelIdx = 0;
	Space::Clear();
	if (Pi::player) {
		Pi::player->MarkDead();
		Space::bodies.remove(Pi::player);
		delete Pi::player;
		Pi::player = 0;
	}

	section = rd.RdSection("PiMisc");
	gameTime = section.Double();
	selectedSystem = StarSystem::Unserialize(section);
	currentSystem = StarSystem::Unserialize(section);

	section = rd.RdSection("Space");
	Space::Unserialize(section);
	
	section = rd.RdSection("Polit");
	Polit::Unserialize(section);

	section = rd.RdSection("SectorView");
	sectorView->Load(section);

	section = rd.RdSection("WorldView");
	worldView->Load(section);

	section = rd.RdSection("LuaModules");
	PiLuaModules::Unserialize(section);
}
开发者ID:Snaar,项目名称:pioneer,代码行数:34,代码来源:Pi.cpp

示例9: Load

void SpaceStation::Load(Serializer::Reader &rd, Space *space)
{
	ModelBody::Load(rd, space);
	MarketAgent::Load(rd);
	int num = rd.Int32();
	if (num > Equip::TYPE_MAX) throw SavedGameCorruptException();
	for (int i=0; i<Equip::TYPE_MAX; i++) {
		m_equipmentStock[i] = 0;
	}
	for (int i=0; i<num; i++) {
		m_equipmentStock[i] = static_cast<Equip::Type>(rd.Int32());
	}
	// load shityard
	int numShipsForSale = rd.Int32();
	for (int i=0; i<numShipsForSale; i++) {
		ShipFlavour s;
		s.Load(rd);
		m_shipsOnSale.push_back(s);
	}
	for (int i=0; i<MAX_DOCKING_PORTS; i++) {
		m_shipDocking[i].shipIndex = rd.Int32();
		m_shipDocking[i].stage = rd.Int32();
		m_shipDocking[i].stagePos = rd.Float();
		m_shipDocking[i].fromPos = rd.Vector3d();
		m_shipDocking[i].fromRot = rd.RdQuaternionf();

		m_openAnimState[i] = rd.Float();
		m_dockAnimState[i] = rd.Float();
	}
	m_bbCreated = rd.Bool();
	m_lastUpdatedShipyard = rd.Double();
	m_sbody = space->GetSystemBodyByIndex(rd.Int32());
	m_numPoliceDocked = rd.Int32();
	InitStation();
}
开发者ID:Nikoraito,项目名称:pioneer,代码行数:35,代码来源:SpaceStation.cpp

示例10: Load

void Missile::Load(Serializer::Reader &rd)
{
	Ship::Load(rd);
	m_ownerIndex = rd.Int32();
	m_targetIndex = rd.Int32();
	m_distToTarget = rd.Double();
	m_power = rd.Int32();
}
开发者ID:unavowed,项目名称:pioneer,代码行数:8,代码来源:Missile.cpp

示例11: Load

void SpaceStation::Load(Serializer::Reader &rd, Space *space)
{
	ModelBody::Load(rd, space);

	m_oldAngDisplacement = 0.0;

	int num = rd.Int32();
	if (num > Equip::TYPE_MAX) throw SavedGameCorruptException();
	const Uint32 numShipDocking = rd.Int32();
	m_shipDocking.reserve(numShipDocking);
	for (Uint32 i=0; i<numShipDocking; i++) {
		m_shipDocking.push_back(shipDocking_t());
		shipDocking_t &sd = m_shipDocking.back();
		sd.shipIndex = rd.Int32();
		sd.stage = rd.Int32();
		sd.stagePos = rd.Float();
		sd.fromPos = rd.Vector3d();
		sd.fromRot = rd.RdQuaternionf();
	}
	// retrieve each of the bay groupings
	const Uint32 numBays = rd.Int32();
	mBayGroups.reserve(numBays);
	for (Uint32 i=0; i<numBays; i++) {
		mBayGroups.push_back(SpaceStationType::SBayGroup());
		SpaceStationType::SBayGroup &bay = mBayGroups.back();
		bay.minShipSize = rd.Int32();
		bay.maxShipSize = rd.Int32();
		bay.inUse = rd.Bool();
		const Uint32 numBayIds = rd.Int32();
		bay.bayIDs.reserve(numBayIds);
		for (Uint32 j=0; j<numBayIds; j++) {
			const Uint32 ID = rd.Int32();
			bay.bayIDs.push_back(ID);
		}
	}

	m_sbody = space->GetSystemBodyByIndex(rd.Int32());
	m_numPoliceDocked = rd.Int32();

	m_doorAnimationStep = rd.Double();
	m_doorAnimationState = rd.Double();

	InitStation();

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

示例12: Load

void Model::Load(Serializer::Reader &rd)
{
	LoadVisitor lv(&rd);
	m_root->Accept(lv);

	for (AnimationContainer::const_iterator i = m_animations.begin(); i != m_animations.end(); ++i)
		(*i)->SetProgress(rd.Double());
	UpdateAnimations();
}
开发者ID:zugz,项目名称:pioneer,代码行数:9,代码来源:Model.cpp

示例13: Load

void Player::Load(Serializer::Reader &rd)
{
	Pi::player = this;
	Ship::Load(rd);
	m_flightControlState = static_cast<FlightControlState>(rd.Int32());
	m_setSpeed = rd.Double();
	m_killCount = rd.Int32();
	m_knownKillCount = rd.Int32();
}
开发者ID:Snaar,项目名称:pioneer,代码行数:9,代码来源:Player.cpp

示例14: Load

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

示例15: Load

void PlayerShipController::Load(Serializer::Reader &rd)
{
	m_flightControlState = static_cast<FlightControlState>(rd.Int32());
	m_setSpeed = rd.Double();
	m_lowThrustPower = rd.Float();
	//figure out actual bodies in PostLoadFixup - after Space body index has been built
	m_combatTargetIndex = rd.Int32();
	m_navTargetIndex = rd.Int32();
	m_setSpeedTargetIndex = rd.Int32();
}
开发者ID:NeuralKernel,项目名称:pioneer,代码行数:10,代码来源:ShipController.cpp


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