本文整理汇总了C++中serializer::Reader::Float方法的典型用法代码示例。如果您正苦于以下问题:C++ Reader::Float方法的具体用法?C++ Reader::Float怎么用?C++ Reader::Float使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类serializer::Reader
的用法示例。
在下文中一共展示了Reader::Float方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Load
void ScannerWidget::Load(Serializer::Reader &rd)
{
m_mode = ScannerMode(rd.Int32());
m_currentRange = rd.Float();
m_manualRange = rd.Float();
m_targetRange = rd.Float();
}
示例2: LoadLmrMaterial
void ShipFlavour::LoadLmrMaterial(Serializer::Reader &rd, LmrMaterial *m)
{
for (int i=0; i<4; i++) m->diffuse[i] = rd.Float();
for (int i=0; i<4; i++) m->specular[i] = rd.Float();
for (int i=0; i<4; i++) m->emissive[i] = rd.Float();
m->shininess = rd.Float();
}
示例3: 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();
}
示例4: ScannerMode
ScannerWidget::ScannerWidget(Graphics::Renderer *r, Serializer::Reader &rd) :
m_renderer(r)
{
m_mode = ScannerMode(rd.Int32());
m_currentRange = rd.Float();
m_manualRange = rd.Float();
m_targetRange = rd.Float();
InitObject();
}
示例5: Load
AICommand::AICommand(Serializer::Reader &rd, CmdName name)
{
m_cmdName = name;
m_fuelEconomy = rd.Float();
m_shipIndex = rd.Int32();
m_child = Load(rd);
}
示例6: Load
void CargoBody::Load(Serializer::Reader &rd, Space *space)
{
DynamicBody::Load(rd, space);
m_type = static_cast<Equip::Type>(rd.Int32());
Init();
m_hitpoints = rd.Float();
}
示例7: Load
void Projectile::Load(Serializer::Reader &rd, Space *space)
{
Body::Load(rd, space);
m_baseVel = rd.Vector3d();
m_dirVel = rd.Vector3d();
m_age = rd.Float();
m_type = rd.Int32();
m_parentIndex = rd.Int32();
}
示例8: 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();
}
示例9: 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();
}
示例10:
SectorView::SectorView(Serializer::Reader &rd)
{
InitDefaults();
m_pos.x = m_posMovingTo.x = rd.Float();
m_pos.y = m_posMovingTo.y = rd.Float();
m_pos.z = m_posMovingTo.z = rd.Float();
m_rotX = m_rotXMovingTo = rd.Float();
m_rotZ = m_rotZMovingTo = rd.Float();
m_zoom = m_zoomMovingTo = rd.Float();
m_inSystem = rd.Bool();
m_current = SystemPath::Unserialize(rd);
m_selected = SystemPath::Unserialize(rd);
m_hyperspaceTarget = SystemPath::Unserialize(rd);
m_matchTargetToSelection = rd.Bool();
m_selectionFollowsMovement = rd.Bool();
m_detailBoxVisible = rd.Byte();
InitObject();
}
示例11: Load
void NavLights::Load(Serializer::Reader &rd)
{
m_time = rd.Float();
m_enabled = rd.Bool();
RefCountedPtr<Graphics::Material> mat;
for (LightIterator it = m_lights.begin(); it != m_lights.end(); ++it) {
Uint8 c = rd.Byte();
it->billboard->SetMaterial(get_material(c));
}
}
示例12: 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));
}
示例13: InitDefaults
SectorView::SectorView(Serializer::Reader &rd)
{
InitDefaults();
m_pos.x = m_posMovingTo.x = rd.Float();
m_pos.y = m_posMovingTo.y = rd.Float();
m_pos.z = m_posMovingTo.z = rd.Float();
m_rotX = m_rotXMovingTo = rd.Float();
m_rotZ = m_rotZMovingTo = rd.Float();
m_zoom = m_zoomMovingTo = rd.Float();
// XXX I have no idea if this is correct,
// I just copied it from the one other place m_zoomClamped is set
m_zoomClamped = Clamp(m_zoom, 1.f, FAR_LIMIT);
m_inSystem = rd.Bool();
m_current = SystemPath::Unserialize(rd);
m_selected = SystemPath::Unserialize(rd);
m_hyperspaceTarget = SystemPath::Unserialize(rd);
m_matchTargetToSelection = rd.Bool();
m_selectionFollowsMovement = rd.Bool();
m_detailBoxVisible = rd.Byte();
InitObject();
}
示例14: 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);
}
示例15: Load
void Ship::Load(Serializer::Reader &rd)
{
DynamicBody::Load(rd);
// 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.Float();
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_dockedWithPort = rd.Int32();
m_dockedWithIndex = rd.Int32();
m_equipment.InitSlotSizes(m_shipFlavour.type);
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_equipment.onChange.connect(sigc::mem_fun(this, &Ship::OnEquipmentChange));
}