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


C++ PlayerOptions::ContainsTransformOrTurn方法代码示例

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


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

示例1: RadarValues

const RadarValues &Trail::GetRadarValues() const
{
	if( m_bRadarValuesCached )
	{
		return m_CachedRadarValues;
	}
	if( IsSecret() )
	{
		// Don't calculate RadarValues for a non-fixed Course.  They values are 
		// worthless because they'll change every time this Trail is 
		// regenerated.
		m_CachedRadarValues = RadarValues();
		return m_CachedRadarValues;
	}
	else
	{
		RadarValues rv;
		rv.Zero();

		FOREACH_CONST( TrailEntry, m_vEntries, e )
		{
			const Steps *pSteps = e->pSteps;
			ASSERT( pSteps != NULL );
			// Hack: don't calculate for autogen entries
			if( !pSteps->IsAutogen() && e->ContainsTransformOrTurn() )
			{
				NoteData nd;
				pSteps->GetNoteData( nd );
				RadarValues rv_orig;
				GAMESTATE->SetProcessedTimingData(const_cast<TimingData *>(pSteps->GetTimingData()));
				NoteDataUtil::CalculateRadarValues( nd, e->pSong->m_fMusicLengthSeconds, rv_orig );
				PlayerOptions po;
				po.FromString( e->Modifiers );
				if( po.ContainsTransformOrTurn() )
				{
					NoteDataUtil::TransformNoteData(nd, *(pSteps->GetTimingData()), po, pSteps->m_StepsType);
				}
				NoteDataUtil::TransformNoteData(nd, *(pSteps->GetTimingData()), e->Attacks, pSteps->m_StepsType, e->pSong);
				RadarValues transformed_rv;
				NoteDataUtil::CalculateRadarValues( nd, e->pSong->m_fMusicLengthSeconds, transformed_rv );
				GAMESTATE->SetProcessedTimingData(NULL);
				rv += transformed_rv;
			}
			else
			{
				rv += pSteps->GetRadarValues( PLAYER_1 );			
			}
		}

		/* Hack: SetRadarValues is non-const (a const setter doesn't
		 * make sense), but it only modifies a mutable value.  Just
		 * cast away const. */
		const_cast<Trail*>(this)->SetRadarValues( rv );

		return m_CachedRadarValues;
	}
}
开发者ID:AratnitY,项目名称:stepmania,代码行数:57,代码来源:Trail.cpp

示例2: ContainsTransformOrTurn

bool TrailEntry::ContainsTransformOrTurn() const
{
	PlayerOptions po;
	po.FromString( Modifiers );
	if( po.ContainsTransformOrTurn() )
		return true;
	if( Attacks.ContainsTransformOrTurn() )
		return true;
	return false;
}
开发者ID:AratnitY,项目名称:stepmania,代码行数:10,代码来源:Trail.cpp

示例3: if

const RadarValues &Trail::GetRadarValues() const
{
	if( m_bRadarValuesCached )
	{
		return m_CachedRadarValues;
	}
	else if( IsSecret() )
	{
		// Don't calculate RadarValues for a non-fixed Course.  The values are
		// worthless because they'll change every time this Trail is 
		// regenerated.
		m_CachedRadarValues = RadarValues();
		return m_CachedRadarValues;
	}
	else
	{
		RadarValues rv;
		rv.Zero();

		FOREACH_CONST( TrailEntry, m_vEntries, e )
		{
			const Steps *pSteps = e->pSteps;
			ASSERT( pSteps );
			/* Hack: don't calculate for autogen entries; it makes writing Catalog.xml
			 * take way too long.  (Tournamix 4 Sample.crs takes me ~10s.) */
			if( !pSteps->IsAutogen() && e->ContainsTransformOrTurn() )
			{
				NoteData nd;
				pSteps->GetNoteData( nd );
				RadarValues rv_orig;
				NoteDataUtil::CalculateRadarValues( nd, e->pSong->MusicLengthSeconds(), rv_orig );
				PlayerOptions po;
				po.FromString( e->Modifiers );
				if( po.ContainsTransformOrTurn() )
					NoteDataUtil::TransformNoteData( nd, po, pSteps->m_StepsType );
				NoteDataUtil::TransformNoteData( nd, e->Attacks, pSteps->m_StepsType, e->pSong );
				RadarValues transformed_rv;
				NoteDataUtil::CalculateRadarValues( nd, e->pSong->MusicLengthSeconds(), transformed_rv );
				rv += transformed_rv;
			}
			else
			{
				rv += pSteps->GetRadarValues();			
			}
		}

		/* Hack: SetRadarValues is non-const (a const setter doesn't
		 * make sense), but it only modifies a mutable value.  Just
		 * cast away const. */
		const_cast<Trail*>(this)->SetRadarValues( rv );

		return m_CachedRadarValues;
	}
}
开发者ID:BitMax,项目名称:openitg,代码行数:54,代码来源:Trail.cpp

示例4: ContainsTransformOrTurn

bool Attack::ContainsTransformOrTurn() const
{
	PlayerOptions po;
	po.FromString(sModifiers);
	return po.ContainsTransformOrTurn();
}
开发者ID:ycaihua,项目名称:fingermania,代码行数:6,代码来源:Attack.cpp


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