コード例 #1
0
ファイル: CourseManager.cpp プロジェクト: Rookiee/CPlusPlus
void CourseManager::delCourse(const std::string & name) {
	int index = FindCourse(name);
	if(index > 0)
		courseList.erase(courseList.begin() + index);
	else
		std::cout << "Not Found" << std::endl;
}
コード例 #2
0
ファイル: CourseManager.cpp プロジェクト: Rookiee/CPlusPlus
void CourseManager::PrintInfo(size_t id) {
    int loc = FindCourse(id);
    if(loc >0)
        std::cout << vecCourse_[loc] << std::endl;
    else
        std::cout << "No Course" << std::endl;
}
コード例 #3
0
ファイル: CourseManager.cpp プロジェクト: Rookiee/CPlusPlus
void CourseManager::PrintInfo(std::string & name) {
    int loc = FindCourse(name);
    if(loc>0)
        std::cout << vecCourse_[loc] << std::endl;
    else
        std::cout << "No Course" << std::endl;
}
コード例 #4
0
ファイル: CourseManager.cpp プロジェクト: Rookiee/CPlusPlus
void CourseManager::RemoveCourse(size_t id) {
    int loc = FindCourse(id);
    if( loc > 0)
        vecCourse_.erase(vecCourse_.begin()+loc);
    else
        std::cout << "Not Found" << std::endl;
}
コード例 #5
0
ファイル: CourseManager.cpp プロジェクト: Rookiee/CPlusPlus
void CourseManager::RemoveCourse(std::string & name) {
    int loc = FindCourse(name);
    if (loc > 0)
        vecCourse_.erase(vecCourse_.begin() + loc);
    else
        std::cout << "Not Found" << std::endl;
}
コード例 #6
0
ファイル: CourseManager.cpp プロジェクト: Rookiee/CPlusPlus
void CourseManager::PrintCourse(const std::string & name) {
	int index = FindCourse(name);
	if(index > 0) {
		std::cout << "Information of Course " << name << ": ";
		std::cout << courseList[index] << std::endl;
	}
	else
		std::cout << "This course is not in the courselist." << std::endl;
}
コード例 #7
0
ファイル: CourseManager.cpp プロジェクト: Rookiee/CPlusPlus
//print the course, parameter is id or name
void CourseManager::PrintCourse(const int id) {
	int index = FindCourse(id);
	if( index > 0 ) {
		std::cout << "Information of ID " << id << ": " ;
		std::cout << courseList[index] << std::endl;
	}
	else
		std::cout << "This ID is not available." << std::endl;
}
コード例 #8
0
bool UnlockSystem::CourseIsLocked( const Course *course ) const
{
	if( !PREFSMAN->m_bUseUnlockSystem )
		return false;

	const UnlockEntry *p = FindCourse( course );
	if( p == NULL )
		return false;

	return p->IsLocked();
}
コード例 #9
0
int UnlockManager::FindCode( const CString &sName ) const
{
	const UnlockEntry *pEntry = NULL;
	
	const Song *pSong = SONGMAN->FindSong( sName );
	if( pSong != NULL )
		pEntry = FindSong( pSong );

	const Course *pCourse = SONGMAN->FindCourse( sName );
	if( pCourse != NULL )
		pEntry = FindCourse( pCourse );
	
	if( pEntry == NULL )
		pEntry = FindModifier( sName );

	if( pEntry == NULL )
	{
		LOG->Warn( "Couldn't find locked entry \"%s\"", sName.c_str() );
		return -1;
	}

	return pEntry->m_iCode;
}