add Course::FindFixedSong, Attack::FromGlobalCourseModifier
This commit is contained in:
@@ -54,6 +54,17 @@ bool Attack::ContainsTransformOrTurn() const
|
||||
return po.ContainsTransformOrTurn();
|
||||
}
|
||||
|
||||
Attack Attack::FromGlobalCourseModifier( const CString &sModifiers )
|
||||
{
|
||||
Attack a;
|
||||
a.fStartSecond = 0;
|
||||
a.fSecsRemaining = 10000; /* whole song */
|
||||
a.level = ATTACK_LEVEL_1;
|
||||
a.sModifier = sModifiers;
|
||||
a.bGlobal = true;
|
||||
return a;
|
||||
}
|
||||
|
||||
bool AttackArray::ContainsTransformOrTurn() const
|
||||
{
|
||||
FOREACH_CONST( Attack, *this, a )
|
||||
|
||||
@@ -37,6 +37,7 @@ struct Attack
|
||||
bool IsBlank() const { return sModifier.empty(); }
|
||||
bool operator== ( const Attack &rhs ) const;
|
||||
bool ContainsTransformOrTurn() const;
|
||||
static Attack FromGlobalCourseModifier( const CString &sModifiers );
|
||||
};
|
||||
|
||||
struct AttackArray : public vector<Attack>
|
||||
|
||||
@@ -1106,6 +1106,18 @@ bool Course::IsRanking() const
|
||||
return false;
|
||||
}
|
||||
|
||||
const CourseEntry *Course::FindFixedSong( const Song *pSong ) const
|
||||
{
|
||||
for( unsigned i = 0; i < m_entries.size(); ++i )
|
||||
{
|
||||
const CourseEntry *pEntry = &m_entries[i];
|
||||
if( pEntry->type == COURSE_ENTRY_FIXED && pEntry->pSong == pSong )
|
||||
return pEntry;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void Course::GetAllCachedTrails( vector<Trail *> &out )
|
||||
{
|
||||
TrailCache_t::iterator it;
|
||||
|
||||
@@ -151,6 +151,8 @@ public:
|
||||
|
||||
void GetAllCachedTrails( vector<Trail *> &out );
|
||||
|
||||
const CourseEntry *FindFixedSong( const Song *pSong ) const;
|
||||
|
||||
private:
|
||||
bool GetTrailUnsorted( StepsType st, CourseDifficulty cd, Trail &trail ) const;
|
||||
bool GetTrailSorted( StepsType st, CourseDifficulty cd, Trail &trail ) const;
|
||||
|
||||
+1
-10
@@ -10,16 +10,7 @@
|
||||
void TrailEntry::GetAttackArray( AttackArray &out ) const
|
||||
{
|
||||
if( !Modifiers.empty() )
|
||||
{
|
||||
Attack a;
|
||||
a.fStartSecond = 0;
|
||||
a.fSecsRemaining = 10000; /* whole song */
|
||||
a.level = ATTACK_LEVEL_1;
|
||||
a.sModifier = Modifiers;
|
||||
a.bGlobal = true;
|
||||
|
||||
out.push_back( a );
|
||||
}
|
||||
out.push_back( Attack::FromGlobalCourseModifier( Modifiers ) );
|
||||
|
||||
out.insert( out.end(), Attacks.begin(), Attacks.end() );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user