Ejemplo n.º 1
0
void CSinglePlayerInfo::Serialize( IArchive& ar, const unsigned int version )
{
	if( ar.GetMode() == IArchive::MODE_INPUT )
	{
		m_pCurrentPlayerBaseEntity = NULL;
//		m_pWeaponSystem;

		m_TaskID = -1;
		m_vecpItem.resize( 0 );

		size_t i, num_item_categories = CItemCategory::NUM_CATEGORIES;
		for( i=0; i<num_item_categories; i++ )
            m_vecpCategoryItem[i].resize(0);

		m_vecpActiveItem.resize(0);

		m_pCurrentAircraft.reset();
	}

	GameItemObjectFactory factory;

	ar.Polymorphic( m_vecpItem, factory );

	ar & m_Money;

	ar & m_KeyBind;

//	ar & m_PlayTime;

	if( ar.GetMode() == IArchive::MODE_INPUT )
	{
		// register items to m_vecpCategoryItem
	}

}
Ejemplo n.º 2
0
void CGI_Aircraft::Serialize( IArchive& ar, const unsigned int version )
{
	GameItem::Serialize( ar, version );

    ar & m_CockpitLocalPose;

    ar & m_vThirdPersonViewOffset;

	ar & m_vecNozzleFlameParams;

	ar & m_fAccel & m_fBoostAccel & m_fBrakeAccel;

//	ar & m_PitchRange & m_RollRange;

	ar & m_fMaxPitchAccel & m_fMaxRollAccel & m_fMaxYawAccel;

//	ar & m_WeaponSystem;

	ar & m_AmmoReleaseLocalPose;

	ar & m_vGunMuzzleEndLocalPos;

	ar & m_fGearUnitHeight;

	ar & m_fCeiling;
	ar & m_fArmor;
	ar & m_fRCS;

	ar & m_vecSupportedAmmo;

	if( ar.GetMode() == IArchive::MODE_INPUT )
	{
		m_fCurrentBoost = 0.0f;
		m_fCurrentBrake = 0.0f;
	}

	// serialization of mesh controllers
	MeshBoneControllerFactory factory;
	ar.Polymorphic( m_vecpMeshController, factory );

	if( ar.GetMode() == IArchive::MODE_INPUT )
	{
		size_t i, num = m_vecpMeshController.size();
		for( i=0; i<num; i++ )
		{
//			if( m_vecpMeshController[i]->GetArchiveObjectID() == MeshBoneControllerBase::ID_... )
//				((MeshBoneController_AircraftBase *)m_vecpMeshController[i])->SetPseudoAircraftSimulator( &m_PseudoSimulator );
				m_vecpMeshController[i]->SetPseudoAircraftSimulator( &m_PseudoSimulator );
		}
	}

//	ar & m_vecRotor;

	ar & m_PrevUsedAmmo;
}
Ejemplo n.º 3
0
	void Serialize( IArchive& ar, const unsigned int version )
	{
		ar & m_ResourceName;

		if( ar.GetMode() == IArchive::MODE_INPUT )
		{
			// initialize the handle
			m_Handle = pooled_object_handle();
		}
	}
Ejemplo n.º 4
0
	virtual void Serialize( IArchive& ar, const unsigned int version )
	{
		ar & m_Buffer.buffer();

		if( ar.GetMode() == IArchive::MODE_INPUT )
		{
			// set the new stream
			// - reset the cursor position
			m_Buffer.reset_pos();
		}
	}
Ejemplo n.º 5
0
	inline virtual void Serialize( IArchive& ar, const unsigned int version )
	{
		std::string name;
		if( ar.GetMode() == IArchive::MODE_INPUT )
		{
			ar & name;
			SetName( name );
		}
		else
		{
			name = GetName();
			ar & name;
		}
	}
Ejemplo n.º 6
0
void CRotatableTurret::Serialize( IArchive& ar, const unsigned int version )
{
	GameItem::Serialize( ar, version );

	ar & m_MountLocalPose;
	ar & m_GunLocalPose;
	ar & m_WeaponName;
	ar & m_vecAmmunition;


	if( ar.GetMode() == IArchive::MODE_INPUT )
	{
		// load ammo?
	}
}