本文整理汇总了C++中Course::Save方法的典型用法代码示例。如果您正苦于以下问题:C++ Course::Save方法的具体用法?C++ Course::Save怎么用?C++ Course::Save使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Course
的用法示例。
在下文中一共展示了Course::Save方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Start
void EditCoursesMenu::Start()
{
if( m_bInSongMenu )
{
m_SongMenu.SaveToCourseEntry( GetSelectedEntry() );
m_bInSongMenu = false;
OnRowValueChanged( ROW_ENTRY );
return;
}
Course* pCourse = GetSelectedCourse();
CourseEntry* pEntry = GetSelectedEntry();
switch( m_SelectedRow )
{
case ROW_COURSE_OPTIONS:
g_CourseOptionsMenu.rows[repeat].defaultChoice = pCourse->m_bRepeat ? 1 : 0;
g_CourseOptionsMenu.rows[randomize].defaultChoice = pCourse->m_bRandomize ? 1 : 0;
g_CourseOptionsMenu.rows[lives].defaultChoice = pCourse->m_iLives;
if( g_CourseOptionsMenu.rows[lives].defaultChoice == -1 )
g_CourseOptionsMenu.rows[lives].defaultChoice = 0;
SCREENMAN->MiniMenu( &g_CourseOptionsMenu, SM_BackFromCourseOptionsMenu );
break;
case ROW_ACTION:
switch( GetSelectedAction() )
{
case save:
m_soundSave.Play();
pCourse->Save();
SCREENMAN->SystemMessage( "Course saved." );
break;
case add_entry:
SCREENMAN->PlayStartSound();
pCourse->m_entries.insert( pCourse->m_entries.begin()+m_iSelection[ROW_ENTRY], pCourse->m_entries[m_iSelection[ROW_ENTRY]] );
OnRowValueChanged( ROW_ENTRY );
break;
case delete_selected_entry:
if( pCourse->m_entries.size() == 1 )
{
SCREENMAN->PlayInvalidSound();
SCREENMAN->SystemMessage( "Cannot delete the last entry from a course" );
break;
}
SCREENMAN->PlayStartSound();
pCourse->m_entries.erase( pCourse->m_entries.begin()+m_iSelection[ROW_ENTRY] );
CLAMP( m_iSelection[ROW_ENTRY], 0, (int) pCourse->m_entries.size()-1 );
OnRowValueChanged( ROW_ENTRY );
break;
default:
ASSERT(0);
}
OnRowValueChanged( ROW_ENTRY );
break;
case ROW_ENTRY_OPTIONS:
m_SongMenu.LoadFromCourseEntry( GetSelectedEntry() );
m_bInSongMenu = true;
break;
case ROW_ENTRY_PLAYER_OPTIONS:
SCREENMAN->PlayStartSound();
GAMESTATE->m_PlayerOptions[PLAYER_1] = PlayerOptions();
GAMESTATE->m_PlayerOptions[PLAYER_1].FromString( pEntry->modifiers );
SCREENMAN->AddNewScreenToTop( "ScreenPlayerOptions", SM_BackFromPlayerOptions );
break;
case ROW_ENTRY_SONG_OPTIONS:
SCREENMAN->PlayStartSound();
GAMESTATE->m_SongOptions = SongOptions();
GAMESTATE->m_SongOptions.FromString( pEntry->modifiers );
SCREENMAN->AddNewScreenToTop( "ScreenSongOptions", SM_BackFromSongOptions );
break;
default:
SCREENMAN->PlayInvalidSound();
return;
}
}