From 5a01cb9c3fb10dcfbe7bfe4cf3b6eca775066168 Mon Sep 17 00:00:00 2001 From: Steve Checkoway Date: Mon, 10 Jul 2006 04:32:33 +0000 Subject: [PATCH] Split out SaveStats to give more flexibility to subclasses that may wish to interact with the stats differently. --- stepmania/src/ScreenGameplay.cpp | 8 ++++++-- stepmania/src/ScreenGameplay.h | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/stepmania/src/ScreenGameplay.cpp b/stepmania/src/ScreenGameplay.cpp index da7114b572..a7fedccfb3 100644 --- a/stepmania/src/ScreenGameplay.cpp +++ b/stepmania/src/ScreenGameplay.cpp @@ -2211,10 +2211,10 @@ void ScreenGameplay::Input( const InputEventPlus &input ) * applying the modifiers the song would have been played with. This doesn't include songs * that were played but failed; that was done in #1. */ -void ScreenGameplay::SongFinished() +void ScreenGameplay::SaveStats() { float fMusicLen = GAMESTATE->m_pCurSong->m_fMusicLengthSeconds; - // save any statistics + FOREACH_EnabledPlayerInfo( m_vPlayerInfo, pi ) { /* Note that adding stats is only meaningful for the counters (eg. RadarCategory_Jumps), @@ -2228,7 +2228,11 @@ void ScreenGameplay::SongFinished() NoteDataWithScoring::GetActualRadarValues( pi->m_pPlayer->m_NoteData, pss, fMusicLen, rv ); pss.radarActual += rv; } +} +void ScreenGameplay::SongFinished() +{ + SaveStats(); // Let subclasses save the stats. /* Extremely important: if we don't remove attacks before moving on to the next * screen, they'll still be turned on eventually. */ GAMESTATE->RemoveAllActiveAttacks(); diff --git a/stepmania/src/ScreenGameplay.h b/stepmania/src/ScreenGameplay.h index fd780a7586..93dd7bcdfd 100644 --- a/stepmania/src/ScreenGameplay.h +++ b/stepmania/src/ScreenGameplay.h @@ -150,6 +150,7 @@ protected: void UpdateSongPosition( float fDeltaTime ); void UpdateLyrics( float fDeltaTime ); void SongFinished(); + virtual void SaveStats(); void StageFinished( bool bBackedOut ); void SaveReplay();