00001 /* Grade - Mark the player receives after clearing a song. */ 00002 00003 #ifndef GRADE_H 00004 #define GRADE_H 00005 00006 #include "RageUtil.h" 00007 00008 #define NUM_GRADE_TIERS 20 00009 enum Grade 00010 { 00011 GRADE_TIER_1, // = AAAA 00012 GRADE_TIER_2, // = AAA 00013 GRADE_TIER_3, // = AA 00014 GRADE_TIER_4, // = A 00015 GRADE_TIER_5, // = B 00016 GRADE_TIER_6, // = C 00017 GRADE_TIER_7, // = D 00018 GRADE_TIER_8, 00019 GRADE_TIER_9, 00020 GRADE_TIER_10, 00021 GRADE_TIER_11, 00022 GRADE_TIER_12, 00023 GRADE_TIER_13, 00024 GRADE_TIER_14, 00025 GRADE_TIER_15, 00026 GRADE_TIER_16, 00027 GRADE_TIER_17, 00028 GRADE_TIER_18, 00029 GRADE_TIER_19, 00030 GRADE_TIER_20, 00031 GRADE_FAILED, // = E 00032 NUM_GRADES, 00033 GRADE_NO_DATA, // ~GRADE_INVALID 00034 }; 00035 00036 /* This is in the header so the test sets don't require Grade.cpp (through PrefsManager), 00037 * since that pulls in ThemeManager. */ 00038 static inline CString GradeToString( Grade g ) 00039 { 00040 // string is meant to be human readable 00041 switch( g ) 00042 { 00043 case GRADE_NO_DATA: return "NoData"; 00044 case GRADE_FAILED: return "Failed"; 00045 default: 00046 return ssprintf("Tier%02d",g+1); 00047 } 00048 } 00049 00050 CString GradeToOldString( Grade g ); // "AAA", "B", etc for backward compatibility 00051 CString GradeToThemedString( Grade g ); 00052 Grade StringToGrade( const CString &s ); 00053 #define FOREACH_Grade( g ) FOREACH_ENUM( Grade, NUM_GRADES, g ) 00054 #define FOREACH_UsedGrade( g ) FOREACH_ENUM( Grade, PREFSMAN->m_iNumGradeTiersUsed, g ) 00055 00056 #endif 00057 00058 /* 00059 * (c) 2001-2004 Chris Danford 00060 * All rights reserved. 00061 * 00062 * Permission is hereby granted, free of charge, to any person obtaining a 00063 * copy of this software and associated documentation files (the 00064 * "Software"), to deal in the Software without restriction, including 00065 * without limitation the rights to use, copy, modify, merge, publish, 00066 * distribute, and/or sell copies of the Software, and to permit persons to 00067 * whom the Software is furnished to do so, provided that the above 00068 * copyright notice(s) and this permission notice appear in all copies of 00069 * the Software and that both the above copyright notice(s) and this 00070 * permission notice appear in supporting documentation. 00071 * 00072 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 00073 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 00074 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF 00075 * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS 00076 * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT 00077 * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS 00078 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 00079 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 00080 * PERFORMANCE OF THIS SOFTWARE. 00081 */