Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

StepsUtil.h

Go to the documentation of this file.
00001 #ifndef STEPSUTIL_H 00002 #define STEPSUTIL_H 00003 00004 #include "GameConstantsAndTypes.h" 00005 #include "Difficulty.h" 00006 00007 class Steps; 00008 class Song; 00009 class Profile; 00010 struct XNode; 00011 00012 namespace StepsUtil 00013 { 00014 bool CompareNotesPointersByRadarValues(const Steps* pSteps1, const Steps* pSteps2); 00015 bool CompareNotesPointersByMeter(const Steps *pSteps1, const Steps* pSteps2); 00016 bool CompareNotesPointersByDifficulty(const Steps *pSteps1, const Steps *pSteps2); 00017 void SortNotesArrayByDifficulty( vector<Steps*> &arrayNotess ); 00018 bool CompareStepsPointersByTypeAndDifficulty(const Steps *pStep1, const Steps *pStep2); 00019 void SortStepsByTypeAndDifficulty( vector<Steps*> &arraySongPointers ); 00020 void SortStepsPointerArrayByNumPlays( vector<Steps*> &vStepsPointers, ProfileSlot slot, bool bDescending ); 00021 void SortStepsPointerArrayByNumPlays( vector<Steps*> &vStepsPointers, const Profile* pProfile, bool bDescending ); 00022 }; 00023 00024 class StepsID 00025 { 00026 StepsType st; 00027 Difficulty dc; 00028 CString sDescription; 00029 unsigned uHash; 00030 00031 public: 00032 StepsID() { Unset(); } 00033 void Unset() { FromSteps(NULL); } 00034 void FromSteps( const Steps *p ); 00035 Steps *ToSteps( const Song *p, bool bAllowNull, bool bUseCache = true ) const; 00036 bool operator<( const StepsID &rhs ) const; 00037 bool MatchesStepsType( StepsType s ) const { return st == s; } 00038 00039 XNode* CreateNode() const; 00040 void LoadFromNode( const XNode* pNode ); 00041 CString ToString() const; 00042 bool IsValid() const; 00043 static void ClearCache(); 00044 }; 00045 00046 #endif 00047 00048 /* 00049 * (c) 2001-2004 Chris Danford, Glenn Maynard 00050 * All rights reserved. 00051 * 00052 * Permission is hereby granted, free of charge, to any person obtaining a 00053 * copy of this software and associated documentation files (the 00054 * "Software"), to deal in the Software without restriction, including 00055 * without limitation the rights to use, copy, modify, merge, publish, 00056 * distribute, and/or sell copies of the Software, and to permit persons to 00057 * whom the Software is furnished to do so, provided that the above 00058 * copyright notice(s) and this permission notice appear in all copies of 00059 * the Software and that both the above copyright notice(s) and this 00060 * permission notice appear in supporting documentation. 00061 * 00062 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 00063 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 00064 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF 00065 * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS 00066 * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT 00067 * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS 00068 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 00069 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 00070 * PERFORMANCE OF THIS SOFTWARE. 00071 */

Generated on Thu Jan 27 20:57:34 2005 for StepMania by doxygen 1.3.7