add LastTapNoteScoreTrack

This commit is contained in:
Glenn Maynard
2003-03-27 00:39:17 +00:00
parent eba90a4b0b
commit c8b9ad3002
2 changed files with 14 additions and 7 deletions
+13 -7
View File
@@ -111,28 +111,34 @@ TapNoteScore NoteDataWithScoring::MinTapNoteScore(unsigned row) const
} }
/* Return the last tap score of a row: the grade of the tap that completed /* Return the last tap score of a row: the grade of the tap that completed
* the row. If the row isn't complete (not all taps have been hit), return * the row. If the row isn't complete (not all taps have been hit), return -1. */
* TNS_MISS. */ int NoteDataWithScoring::LastTapNoteScoreTrack(unsigned row) const
TapNoteScore NoteDataWithScoring::LastTapNoteScore(unsigned row) const
{ {
TapNoteScore score = TNS_MARVELOUS;
float scoretime = -9999; float scoretime = -9999;
int best_track = -1;
for( int t=0; t<GetNumTracks(); t++ ) for( int t=0; t<GetNumTracks(); t++ )
{ {
/* If there's no tap note on this row, skip it; the score will always be TNS_NONE. */ /* If there's no tap note on this row, skip it; the score will always be TNS_NONE. */
if(GetTapNote(t, row) == TAP_EMPTY) continue; if(GetTapNote(t, row) == TAP_EMPTY) continue;
TapNoteScore tns = GetTapNoteScore(t, row); TapNoteScore tns = GetTapNoteScore(t, row);
if(tns == TNS_MISS) return TNS_MISS; if(tns == TNS_MISS) return t;
float tm = GetTapNoteOffset(t, row); float tm = GetTapNoteOffset(t, row);
if(tm < scoretime) continue; if(tm < scoretime) continue;
score = tns;
scoretime = tm; scoretime = tm;
best_track = t;
} }
return score; return best_track;
}
TapNoteScore NoteDataWithScoring::LastTapNoteScore(unsigned row) const
{
int track = LastTapNoteScoreTrack(row);
if(track == -1) return TNS_NONE;
return GetTapNoteScore(track, row);
} }
+1
View File
@@ -50,6 +50,7 @@ public:
void SetHoldNoteLife(unsigned h, float f); void SetHoldNoteLife(unsigned h, float f);
TapNoteScore MinTapNoteScore(unsigned row) const; TapNoteScore MinTapNoteScore(unsigned row) const;
int LastTapNoteScoreTrack(unsigned row) const;
TapNoteScore LastTapNoteScore(unsigned row) const; TapNoteScore LastTapNoteScore(unsigned row) const;
float GetActualRadarValue( RadarCategory rv, float fSongSeconds ) const; float GetActualRadarValue( RadarCategory rv, float fSongSeconds ) const;