add Course::FindFixedSong, Attack::FromGlobalCourseModifier

This commit is contained in:
Glenn Maynard
2005-01-03 23:30:56 +00:00
parent c82a6fa313
commit 0f010d2321
5 changed files with 27 additions and 10 deletions
+11
View File
@@ -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 )
+1
View File
@@ -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>
+12
View File
@@ -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;
+2
View File
@@ -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
View File
@@ -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() );
}