void RadarValues::LoadFromNode( const XNode* pNode ) { ASSERT( pNode->m_sName == "RadarValues" ); Zero(); FOREACH_RadarCategory( rc ) pNode->GetChildValue( RadarCategoryToString(rc), m_Values.f[rc] ); }
void SMLoader::LoadFromSMTokens( CString sStepsType, CString sDescription, CString sDifficulty, CString sMeter, CString sRadarValues, CString sNoteData, CString sAttackData, Steps &out ) { TrimLeft(sStepsType); TrimRight(sStepsType); TrimLeft(sDescription); TrimRight(sDescription); TrimLeft(sDifficulty); TrimRight(sDifficulty); // LOG->Trace( "Steps::LoadFromSMTokens()" ); out.m_StepsType = GameManager::StringToStepsType(sStepsType); out.SetDescription(sDescription); out.SetDifficulty(StringToDifficulty( sDifficulty )); // HACK: We used to store SMANIAC as DIFFICULTY_HARD with special description. // Now, it has its own DIFFICULTY_CHALLENGE if( sDescription.CompareNoCase("smaniac") == 0 ) out.SetDifficulty( DIFFICULTY_CHALLENGE ); // HACK: We used to store CHALLENGE as DIFFICULTY_HARD with special description. // Now, it has its own DIFFICULTY_CHALLENGE if( sDescription.CompareNoCase("challenge") == 0 ) out.SetDifficulty( DIFFICULTY_CHALLENGE ); out.SetMeter(atoi(sMeter)); CStringArray saValues; split( sRadarValues, ",", saValues, true ); if( saValues.size() == NUM_RADAR_CATEGORIES ) { RadarValues v; FOREACH_RadarCategory(rc) v[rc] = strtof( saValues[rc], NULL ); out.SetRadarValues( v ); } out.SetSMNoteData(sNoteData, sAttackData); out.TidyUpData(); }
void RadarValues::FromString( CString sRadarValues ) { CStringArray saValues; split( sRadarValues, ",", saValues, true ); if( saValues.size() != NUM_RADAR_CATEGORIES ) { MakeUnknown(); return; } FOREACH_RadarCategory(rc) m_Values.f[rc] = strtof( saValues[rc], NULL ); }
void RadarValues::Zero() { FOREACH_RadarCategory( rc ) m_Values.f[rc] = 0; }
void RadarValues::MakeUnknown() { FOREACH_RadarCategory( rc ) m_Values.f[rc] = RADAR_VAL_UNKNOWN; }