add DifficultyMeter::SetFromTrail (not used yet)

This commit is contained in:
Glenn Maynard
2004-06-02 08:17:27 +00:00
parent 80efe21839
commit f87cb30d37
2 changed files with 37 additions and 1 deletions
+34
View File
@@ -110,6 +110,40 @@ void DifficultyMeter::SetFromSteps( const Steps* pSteps )
SetDifficulty( DifficultyToString( pSteps->GetDifficulty() ) );
}
void DifficultyMeter::SetFromTrail( const Trail* pTrail )
{
if( pTrail == NULL )
{
Unset();
return;
}
Difficulty FakeDifficulty;
switch( pTrail->m_CourseDifficulty )
{
case COURSE_DIFFICULTY_EASY: FakeDifficulty = DIFFICULTY_EASY; break;
case COURSE_DIFFICULTY_REGULAR: FakeDifficulty = DIFFICULTY_MEDIUM; break;
case COURSE_DIFFICULTY_DIFFICULT: FakeDifficulty = DIFFICULTY_HARD; break;
default: ASSERT(0);
}
/*
if( pTrail->m_iMeter <= 1 )
FakeDifficulty = DIFFICULTY_BEGINNER;
else if( pTrail->m_iMeter <= 3 )
FakeDifficulty = DIFFICULTY_EASY;
else if( pTrail->m_iMeter <= 6 )
FakeDifficulty = DIFFICULTY_MEDIUM;
else if( pTrail->m_iMeter <= 9 )
FakeDifficulty = DIFFICULTY_HARD;
else
FakeDifficulty = DIFFICULTY_CHALLENGE;
*/
SetFromMeterAndDifficulty( pTrail->m_iMeter, FakeDifficulty );
SetDifficulty( DifficultyToString(FakeDifficulty) + "Course" );
}
void DifficultyMeter::SetFromCourse( const Course* pCourse, PlayerNumber pn )
{
if( pCourse == NULL )
+3 -1
View File
@@ -19,6 +19,7 @@
class Steps;
class Course;
class Trail;
class DifficultyMeter: public ActorFrame
@@ -30,7 +31,8 @@ public:
void SetFromGameState( PlayerNumber pn );
void SetFromMeterAndDifficulty( int iMeter, Difficulty dc );
void SetFromSteps( const Steps* pSteps );
void SetFromCourse( const Course* pCourse, PlayerNumber pn );
void SetFromCourse( const Course* pCourse, PlayerNumber pn ); /* deprecated */
void SetFromTrail( const Trail* pTrail );
void Unset();
private: