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


C++ Archiver::ArchiveString方法代码示例

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


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

示例1: DoArchive

//
// Name:        DoArchive
// Parameters:  Archiver &arc
//              Actor *actor
// Description: Sets the Actor pointer during archiving
//
void PackageManager::DoArchive( Archiver &arc , Actor *actor )
{
	int i;
	BehaviorPackageEntry_t *pEntry;
	BehaviorPackageType_t  *package;
	int numPackages;
	str packageName;

	if ( actor )
		act = actor;
	else 
		gi.Error( ERR_FATAL, "PackageManager::DoArchive -- actor is NULL" );

	if ( arc.Loading() )
	{
		arc.ArchiveInteger( &numPackages );

		for ( i = 1 ; i <= numPackages ; i++ )
		{
			arc.ArchiveString( &packageName );

			RegisterPackage( packageName );

			// The package we just added should always be the last one

			pEntry = &_BehaviorPackages.ObjectAt( _BehaviorPackages.NumObjects() );

			arc.ArchiveFloat( &pEntry->currentScore );
			arc.ArchiveFloat( &pEntry->lastScore );
			arc.ArchiveFloat( &pEntry->lastTimeExecuted );
			arc.ArchiveFloat( &pEntry->priority );
		}

	}
	else
	{
		numPackages = _BehaviorPackages.NumObjects();
		arc.ArchiveInteger( &numPackages );

		for ( i = 1 ; i <= _BehaviorPackages.NumObjects() ; i++ )
		{
			pEntry = &_BehaviorPackages.ObjectAt( i );

			package = PackageList.ObjectAt( pEntry->packageIndex );

			arc.ArchiveString( &package->packageName );

			arc.ArchiveFloat( &pEntry->currentScore );
			arc.ArchiveFloat( &pEntry->lastScore );
			arc.ArchiveFloat( &pEntry->lastTimeExecuted );
			arc.ArchiveFloat( &pEntry->priority );
		}
	}

	arc.ArchiveInteger( &_currentFVarIndex );
	arc.ArchiveFloat( &_currentFVarLastExecuteTime );
	arc.ArchiveInteger( &_currentPackageIndex );
}
开发者ID:UberGames,项目名称:EF2GameSource,代码行数:64,代码来源:RageAI.cpp

示例2: Archive

inline void dfunction_t::Archive( Archiver &arc )
{
    Class::Archive( arc );

    arc.ArchiveInteger( &eventnum );
    arc.ArchiveInteger( &first_statement );
    arc.ArchiveInteger( &parm_start );
    arc.ArchiveInteger( &parm_total );
    arc.ArchiveInteger( &locals );

    arc.ArchiveInteger( &profile );

    arc.ArchiveString( &s_name );
    arc.ArchiveString( &s_file );

    arc.ArchiveInteger( &numparms );
    arc.ArchiveInteger( &minparms );

    if ( arc.Loading() )
    {
        memset( &parm_size, 0, sizeof( parm_size[0] ) * MAX_PARMS );
        memset( &parm_type, 0, sizeof( parm_type[0] ) * MAX_PARMS );
    }

    arc.ArchiveRaw( parm_size, sizeof( parm_size[0] ) * numparms );
    arc.ArchiveRaw( parm_type, sizeof( parm_type[0] ) * numparms );
}
开发者ID:UberGames,项目名称:EF2GameSource,代码行数:27,代码来源:program.cpp

示例3: Archive

inline void MoveRandomDirection::Archive(Archiver& arc) {
	Behavior::Archive(arc);

	// Archive Parameters
	arc.ArchiveString(&anim);

	// Archive Components
	arc.ArchiveObject(&_chase);

	// Archive Member Vars
	arc.ArchiveVector(&_destination);
	arc.ArchiveUnsigned(&_mode);
	arc.ArchiveFloat(&_dist);
	arc.ArchiveFloat(&_minDistance);
	arc.ArchiveFloat(&_nextChangeTime);
	arc.ArchiveBool(&_foundGoodDestination);
	arc.ArchiveBool(&_forever);
	arc.ArchiveBool(&_faceEnemy);
	arc.ArchiveString(&_torsoAnim);
}
开发者ID:UberGames,项目名称:EF2GameSource,代码行数:20,代码来源:MoveRandomDirection.hpp

示例4: Archive

inline void Talk::Archive(Archiver& arc) {
    Behavior::Archive(arc);

    arc.ArchiveObject(&turnto);
    arc.ArchiveSafePointer(&ent_listening);
    arc.ArchiveSafePointer(&last_headwatch_target);
    arc.ArchiveFloat(&original_yaw);
    arc.ArchiveFloat(&yaw);
    arc.ArchiveInteger(&mode);
    arc.ArchiveBoolean(&move_allowed);
    arc.ArchiveBool(&animDone);
    arc.ArchiveString(&oldAnimName);
}
开发者ID:UberGames,项目名称:EF2GameSource,代码行数:13,代码来源:talk.hpp

示例5: Archive

void Entity::Archive( Archiver &arc )
{
	SimpleEntity::Archive( arc );

	arc.ArchiveBoolean( &fShader );

	if( fShader )
	{
		arc.ArchiveString( &shader );

		if( arc.Loading() ) {
			customshader = cgi.R_RegisterShader( shader );
		}
	}

	arc.ArchiveBoolean( &canThink );

	arc.ArchiveFloat( &scale );
	arc.ArchiveInteger( &entnum );
	arc.ArchiveInteger( &renderFx );

	arc.ArchiveString( &model );
}
开发者ID:kingtiger01,项目名称:openmohaa-1,代码行数:23,代码来源:centity.cpp

示例6: Archive

//--------------------------------------------------------------
// Name:		Archive()
// Class:		PostureController
//
// Description:	Archives the class
//
// Parameters:	Archiver &arc
//
// Returns:		None
//--------------------------------------------------------------
void PostureController::Archive( Archiver &arc )
{
	arc.ArchiveString( &_postureStateMap_Name );
	arc.ArchiveString( &_currentPostureState_Name );
	arc.ArchiveString( &_requestedPostureState_Name );
	arc.ArchiveSafePointer ( &_requestor );

	if ( !arc.Saving() )
	{
		if ( _postureStateMap_Name.length() )
		{
			Event *event;

			event = new Event( EV_Actor_SetPostureStateMap );							  
			event->AddString( _postureStateMap_Name );
			event->AddInteger( 1 );
			act->ProcessEvent ( event );

			_currentPostureState = _postureStateMap->FindState( _currentPostureState_Name.c_str() );
			_requestedPostureState = _postureStateMap->FindState(_requestedPostureState_Name.c_str() );
		}
	}		
}
开发者ID:UberGames,项目名称:EF2GameSource,代码行数:33,代码来源:actor_posturecontroller.cpp

示例7: Archive

void Personality::Archive( Archiver &arc )
{
	int i;
	int j;
	int num;
	str packageName;
	BehaviorPackageType_t  *package;
	PackageTendency_t      *tendency;
	PackageTendency_t      tempTendency;
	
	Tendency_t             tempGeneralTendency;
	Tendency_t             *generalTendency;
	
	tempTendency.packageIndex = 0;
	tempTendency.tendency = 0.0f;
	tempTendency.lastTendencyCheck = 0.0f;
	
	arc.ArchiveFloat( &_aggressiveness );
	arc.ArchiveFloat( &_talkiness );
	
	arc.ArchiveFloat( &_anger );
	arc.ArchiveFloat( &_fear );
	
	if ( arc.Saving() )
	{
		num = _PackageTendencies.NumObjects();
		
		arc.ArchiveInteger( &num );
		
		for ( i = 1 ; i <= num ; i++ )
		{
			tendency = &_PackageTendencies.ObjectAt( i );
			
			package = PackageList.ObjectAt( tendency->packageIndex );
			
			arc.ArchiveString( &package->packageName );
			arc.ArchiveFloat( &tendency->tendency );
			arc.ArchiveFloat( &tendency->lastTendencyCheck );
			
		}
	}
	else
	{
		arc.ArchiveInteger( &num );
		
		_PackageTendencies.ClearObjectList();
		_PackageTendencies.Resize( num );
		
		for ( i = 1 ; i <= num ; i++ )
		{
			_PackageTendencies.AddObject( tempTendency );
			
			tendency = &_PackageTendencies.ObjectAt( i );
			
			arc.ArchiveString( &packageName );
			
			// Find index
			
			tendency->packageIndex = -1;
			
			for ( j = 1 ; j <= PackageList.NumObjects() ; j++ )
			{
				package = PackageList.ObjectAt( j );
				
				if ( stricmp( packageName.c_str() , package->packageName.c_str() ) == 0 )
				{
					tendency->packageIndex = j;
					break;
				}
			}
			
			assert( tendency->packageIndex != -1 );
			
			arc.ArchiveFloat( &tendency->tendency );
			arc.ArchiveFloat( &tendency->lastTendencyCheck );
		}
	}
	
	
	if ( arc.Saving() )
	{
		num = _Tendencies.NumObjects();
		
		arc.ArchiveInteger( &num );
		
		for ( i = 1 ; i <= num ; i++ )
		{
			generalTendency = &_Tendencies.ObjectAt( i );		
			
			arc.ArchiveString( &generalTendency->tendencyName  );
			arc.ArchiveFloat( &generalTendency->tendencyValue  );	
			
		}
	}
	else
	{
		arc.ArchiveInteger( &num );
		
		_Tendencies.ClearObjectList();
		_Tendencies.Resize( num );
//.........这里部分代码省略.........
开发者ID:UberGames,项目名称:EF2GameSource,代码行数:101,代码来源:RageAI.cpp


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