本文整理汇总了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;
}
}
示例2: ContainsTransformOrTurn
bool TrailEntry::ContainsTransformOrTurn() const
{
PlayerOptions po;
po.FromString( Modifiers );
if( po.ContainsTransformOrTurn() )
return true;
if( Attacks.ContainsTransformOrTurn() )
return true;
return false;
}
示例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;
}
}
示例4: ContainsTransformOrTurn
bool Attack::ContainsTransformOrTurn() const
{
PlayerOptions po;
po.FromString(sModifiers);
return po.ContainsTransformOrTurn();
}