add courses preferred sort

This commit is contained in:
Chris Danford
2006-05-01 21:49:59 +00:00
parent accc12d8f8
commit 8814cb747d
9 changed files with 215 additions and 69 deletions
+21
View File
@@ -884,6 +884,27 @@ void Course::CalculateRadarValues()
}
}
bool Course::Matches( RString sGroup, RString sCourse ) const
{
if( sGroup.size() && sGroup.CompareNoCase(this->m_sGroupName) != 0)
return false;
RString sFile = m_sPath;
sFile.Replace("\\","/");
vector<RString> bits;
split( sFile, "/", bits );
ASSERT(bits.size() >= 2); /* should always have at least two parts */
const RString &sLastBit = bits[bits.size()-1];
if( sCourse.EqualsNoCase(sLastBit) )
return true;
if( sCourse.EqualsNoCase(this->GetTranslitFullTitle()) )
return true;
return false;
}
// lua start
#include "LuaBinding.h"