From e6e471d2df5e149c47435b4203974c489be47bc7 Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Sun, 28 Apr 2013 22:48:08 -0400 Subject: [PATCH] Goodies! (Except for Mac) --- src/Course.cpp | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/src/Course.cpp b/src/Course.cpp index 2e9ebe13c5..51ad58cd47 100644 --- a/src/Course.cpp +++ b/src/Course.cpp @@ -697,6 +697,7 @@ int Course::GetMeter( StepsType st, CourseDifficulty cd ) const bool Course::HasMods() const { +#ifdef MACOSX for (CourseEntry const &e : m_vEntries) { if( !e.attacks.empty() ) @@ -704,6 +705,9 @@ bool Course::HasMods() const } return false; +#else + return std::any_of(m_vEntries.begin(), m_vEntries.end(), [](CourseEntry const &e) { return !e.attacks.empty(); }); +#endif } bool Course::HasTimedMods() const @@ -714,26 +718,38 @@ bool Course::HasTimedMods() const // take longer than expected. -aj for (CourseEntry const &e : m_vEntries) { - if( !e.attacks.empty() ) + if( e.attacks.empty() ) { - for (Attack const &attack : e.attacks) - { - if(!attack.bGlobal) - return true; - } + continue; } +#ifdef MACOSX + for (Attack const &attack : e.attacks) + { + if(!attack.bGlobal) + return true; + } +#else + if (std::any_of(e.attacks.begin(), e.attacks.end(), [](Attack const &a) { return !a.bGlobal; })) + { + return true; + } +#endif } return false; } bool Course::AllSongsAreFixed() const { +#ifdef MACOSX for (CourseEntry const &e : m_vEntries) { if( !e.IsFixedSong() ) return false; } return true; +#else + return std::all_of(m_vEntries.begin(), m_vEntries.end(), [](CourseEntry const &e) { return e.IsFixedSong(); }); +#endif } const Style *Course::GetCourseStyle( const Game *pGame, int iNumPlayers ) const