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


C++ IArchive::GetMode方法代码示例

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


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

示例1: Serialize

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
	}

}
开发者ID:HermanHGF,项目名称:amorphous,代码行数:35,代码来源:PlayerInfo.cpp

示例2: Serialize

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;
}
开发者ID:HermanHGF,项目名称:amorphous,代码行数:55,代码来源:GI_Aircraft.cpp

示例3: Serialize

	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();
		}
	}
开发者ID:HermanHGF,项目名称:amorphous,代码行数:10,代码来源:SoundHandle.hpp

示例4: Serialize

	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();
		}
	}
开发者ID:HermanHGF,项目名称:amorphous,代码行数:11,代码来源:SerializableStream.hpp

示例5: Serialize

	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;
		}
	}
开发者ID:HermanHGF,项目名称:amorphous,代码行数:14,代码来源:NamedResourceHandle.hpp

示例6: Serialize

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?
	}
}
开发者ID:HermanHGF,项目名称:amorphous,代码行数:15,代码来源:RotatableTurret.cpp


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