Make CourseDifficulty its own enum.
This commit is contained in:
@@ -40,11 +40,11 @@ Difficulty StringToDifficulty( const RString& sDC )
|
||||
else if( s2 == "maniac" ) return DIFFICULTY_HARD;
|
||||
else if( s2 == "heavy" ) return DIFFICULTY_HARD;
|
||||
else if( s2 == "smaniac" ) return DIFFICULTY_CHALLENGE;
|
||||
else if( s2 == "challenge" )return DIFFICULTY_CHALLENGE;
|
||||
else if( s2 == "challenge" ) return DIFFICULTY_CHALLENGE;
|
||||
else if( s2 == "expert" ) return DIFFICULTY_CHALLENGE;
|
||||
else if( s2 == "oni" ) return DIFFICULTY_CHALLENGE;
|
||||
else if( s2 == "edit" ) return DIFFICULTY_EDIT;
|
||||
else return Difficulty_Invalid;
|
||||
else return Difficulty_Invalid;
|
||||
}
|
||||
|
||||
static const char *CourseDifficultyNames[] =
|
||||
@@ -59,17 +59,18 @@ static const char *CourseDifficultyNames[] =
|
||||
XToString( CourseDifficulty, NUM_Difficulty );
|
||||
XToLocalizedString( CourseDifficulty );
|
||||
StringToX( CourseDifficulty );
|
||||
LuaXType( CourseDifficulty );
|
||||
|
||||
LuaFunction( CourseDifficultyToLocalizedString, CourseDifficultyToLocalizedString(Enum::Check<Difficulty>(L, 1)) );
|
||||
LuaFunction( CourseDifficultyToLocalizedString, CourseDifficultyToLocalizedString(Enum::Check<CourseDifficulty>(L, 1)) );
|
||||
|
||||
CourseDifficulty GetNextShownCourseDifficulty( CourseDifficulty cd )
|
||||
{
|
||||
for( CourseDifficulty d=(CourseDifficulty)(cd+1); d<NUM_Difficulty; ((int&)d)++ )
|
||||
for( CourseDifficulty d=enum_add2(cd,1); d<NUM_CourseDifficulty; enum_add(d, 1) )
|
||||
{
|
||||
if( GAMESTATE->IsCourseDifficultyShown(d) )
|
||||
return d;
|
||||
}
|
||||
return Difficulty_Invalid;
|
||||
return CourseDifficulty_Invalid;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
+19
-12
@@ -6,7 +6,7 @@
|
||||
//
|
||||
// Player number stuff
|
||||
//
|
||||
enum Difficulty
|
||||
enum Difficulty
|
||||
{
|
||||
DIFFICULTY_BEGINNER,
|
||||
DIFFICULTY_EASY,
|
||||
@@ -23,18 +23,25 @@ const RString& DifficultyToLocalizedString( Difficulty dc );
|
||||
Difficulty StringToDifficulty( const RString& sDC );
|
||||
LuaDeclareType( Difficulty );
|
||||
|
||||
enum CourseDifficulty
|
||||
{
|
||||
COURSE_DIFFICULTY_BEGINNER,
|
||||
COURSE_DIFFICULTY_EASY,
|
||||
COURSE_DIFFICULTY_REGULAR,
|
||||
COURSE_DIFFICULTY_DIFFICULT,
|
||||
COURSE_DIFFICULTY_CHALLENGE,
|
||||
COURSE_DIFFICULTY_EDIT,
|
||||
NUM_CourseDifficulty,
|
||||
CourseDifficulty_Invalid
|
||||
};
|
||||
#define FOREACH_CourseDifficulty( cd ) FOREACH_ENUM( CourseDifficulty, cd )
|
||||
#define FOREACH_ShownCourseDifficulty( cd ) for( CourseDifficulty cd=GetNextShownCourseDifficulty((CourseDifficulty)-1); cd!=CourseDifficulty_Invalid; cd=GetNextShownCourseDifficulty(cd) )
|
||||
|
||||
typedef Difficulty CourseDifficulty;
|
||||
#define NUM_CourseDifficulty NUM_Difficulty
|
||||
#define CourseDifficulty_Invalid Difficulty_Invalid
|
||||
#define FOREACH_CourseDifficulty FOREACH_Difficulty
|
||||
#define FOREACH_ShownCourseDifficulty( cd ) for( Difficulty cd=GetNextShownCourseDifficulty((CourseDifficulty)-1); cd!=Difficulty_Invalid; cd=GetNextShownCourseDifficulty(cd) )
|
||||
|
||||
const RString& CourseDifficultyToString( Difficulty dc );
|
||||
const RString& CourseDifficultyToLocalizedString( Difficulty dc );
|
||||
Difficulty StringToCourseDifficulty( const RString& sDC );
|
||||
|
||||
Difficulty GetNextShownCourseDifficulty( Difficulty pn );
|
||||
const RString& CourseDifficultyToString( CourseDifficulty dc );
|
||||
const RString& CourseDifficultyToLocalizedString( CourseDifficulty dc );
|
||||
CourseDifficulty StringToCourseDifficulty( const RString& sDC );
|
||||
LuaDeclareType( CourseDifficulty );
|
||||
CourseDifficulty GetNextShownCourseDifficulty( CourseDifficulty pn );
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user