#ifndef COURSEUTIL_H #define COURSEUTIL_H /* ----------------------------------------------------------------------------- Class: CourseUtil Desc: A queue of songs and notes. Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved. Chris Danford ----------------------------------------------------------------------------- */ #include "GameConstantsAndTypes.h" class Course; class Profile; struct XNode; namespace CourseUtil { void SortCoursePointerArrayByDifficulty( vector &apCourses ); void SortCoursePointerArrayByType( vector &apCourses ); void SortCoursePointerArrayByAvgDifficulty( vector &apCourses ); void SortCoursePointerArrayByTotalDifficulty( vector &apCourses ); void SortCoursePointerArrayByRanking( vector &apCourses ); void SortCoursePointerArrayByNumPlays( vector &arrayCoursePointers, ProfileSlot slot, bool bDescending ); void SortCoursePointerArrayByNumPlays( vector &arrayCoursePointers, const Profile* pProfile, bool bDescending ); void MoveRandomToEnd( vector &apCourses ); }; class CourseID { CString sPath; CString sName; public: CourseID() { Unset(); } void Unset() { FromCourse(NULL); } void FromCourse( const Course *p ); Course *ToCourse() const; bool operator<( const CourseID &other ) const { return sPath < other.sPath || sName < other.sName; } XNode* CreateNode() const; void LoadFromNode( const XNode* pNode ); bool IsValid() const; }; #endif