Files
itgmania212121/stepmania/src/CourseUtil.h
T

84 lines
3.1 KiB
C++
Raw Normal View History

2004-05-31 22:42:12 +00:00
/* CourseUtil - Utility functions that deal with Course. */
#ifndef COURSEUTIL_H
#define COURSEUTIL_H
#include "GameConstantsAndTypes.h"
2006-01-09 21:57:41 +00:00
#include "Difficulty.h"
class Course;
class Profile;
class XNode;
2005-08-03 03:28:13 +00:00
class CourseEntry;
2006-01-09 21:57:41 +00:00
class Song;
namespace CourseUtil
{
2005-04-25 22:44:32 +00:00
void SortCoursePointerArrayByDifficulty( vector<Course*> &vpCoursesInOut );
void SortCoursePointerArrayByType( vector<Course*> &vpCoursesInOut );
void SortCoursePointerArrayByTitle( vector<Course*> &vpCoursesInOut );
void SortCoursePointerArrayByAvgDifficulty( vector<Course*> &vpCoursesInOut );
void SortCoursePointerArrayByTotalDifficulty( vector<Course*> &vpCoursesInOut );
void SortCoursePointerArrayByRanking( vector<Course*> &vpCoursesInOut );
void SortCoursePointerArrayByNumPlays( vector<Course*> &vpCoursesInOut, ProfileSlot slot, bool bDescending );
void SortCoursePointerArrayByNumPlays( vector<Course*> &vpCoursesInOut, const Profile* pProfile, bool bDescending );
void SortByMostRecentlyPlayedForMachine( vector<Course*> &vpCoursesInOut );
2005-04-25 22:44:32 +00:00
void MoveRandomToEnd( vector<Course*> &vpCoursesInOut );
2005-08-03 03:28:13 +00:00
void MakeDefaultEditCourseEntry( CourseEntry &out );
2006-01-09 21:57:41 +00:00
2006-01-22 01:00:06 +00:00
void AutogenEndlessFromGroup( const RString &sGroupName, Difficulty dc, Course &out );
void AutogenNonstopFromGroup( const RString &sGroupName, Difficulty dc, Course &out );
void AutogenOniFromArtist( const RString &sArtistName, RString sArtistNameTranslit, vector<Song*> aSongs, Difficulty dc, Course &out );
};
class CourseID
{
public:
2006-01-22 01:00:06 +00:00
RString sPath;
RString sFullTitle;
public:
2004-04-22 22:01:38 +00:00
CourseID() { Unset(); }
void Unset() { FromCourse(NULL); }
void FromCourse( const Course *p );
Course *ToCourse() const;
bool operator<( const CourseID &other ) const
{
2004-07-11 10:02:38 +00:00
return sPath < other.sPath || sFullTitle < other.sFullTitle;
}
XNode* CreateNode() const;
void LoadFromNode( const XNode* pNode );
2006-01-22 01:00:06 +00:00
RString ToString() const;
bool IsValid() const;
};
#endif
2004-05-31 22:42:12 +00:00
/*
* (c) 2001-2004 Chris Danford
* All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, and/or sell copies of the Software, and to permit persons to
* whom the Software is furnished to do so, provided that the above
* copyright notice(s) and this permission notice appear in all copies of
* the Software and that both the above copyright notice(s) and this
* permission notice appear in supporting documentation.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
* THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS
* INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/