allow courses to set their preferred style

This commit is contained in:
Glenn Maynard
2007-04-10 23:59:14 +00:00
parent 1de53984ad
commit ab5ef1ef2a
7 changed files with 93 additions and 21 deletions
+16
View File
@@ -16,6 +16,8 @@
#include "Steps.h"
#include "ThemeManager.h"
#include "UnlockManager.h"
#include "Game.h"
#include "Style.h"
static Preference<int> MAX_SONGS_IN_EDIT_COURSE( "MaxSongsInEditCourse", -1 );
@@ -711,6 +713,20 @@ bool Course::AllSongsAreFixed() const
return true;
}
const Style *Course::GetCourseStyle( const Game *pGame ) const
{
for( int s=0; pGame->m_apStyles[s]; ++s )
{
const Style *pStyle = pGame->m_apStyles[s];
FOREACHS_CONST( RString, m_setStyles, style )
{
if( !style->CompareNoCase(pStyle->m_szName) )
return pStyle;
}
}
return NULL;
}
void Course::Invalidate( const Song *pStaleSong )
{
FOREACH_CONST( CourseEntry, m_vEntries, e )