method name cleanup, add comments
This commit is contained in:
@@ -481,7 +481,7 @@ int NoteData::GetNumRowsWithTapOrHoldHead( int iStartIndex, int iEndIndex ) cons
|
||||
return iNumNotes;
|
||||
}
|
||||
|
||||
int NoteData::RowNeedsHands( const int row ) const
|
||||
bool NoteData::RowNeedsAtLeastSimultaneousPresses( int iMinSimultaneousPresses, const int row ) const
|
||||
{
|
||||
int iNumNotesThisIndex = 0;
|
||||
for( int t=0; t<GetNumTracks(); t++ )
|
||||
@@ -501,7 +501,7 @@ int NoteData::RowNeedsHands( const int row ) const
|
||||
if( !iNumNotesThisIndex )
|
||||
return false;
|
||||
|
||||
if( iNumNotesThisIndex < 3 )
|
||||
if( iNumNotesThisIndex < iMinSimultaneousPresses )
|
||||
{
|
||||
/* We have at least one, but not enough. Count holds. Do count adjacent holds. */
|
||||
for( int t=0; t<GetNumTracks(); ++t )
|
||||
@@ -511,10 +511,10 @@ int NoteData::RowNeedsHands( const int row ) const
|
||||
}
|
||||
}
|
||||
|
||||
return iNumNotesThisIndex >= 3;
|
||||
return iNumNotesThisIndex >= iMinSimultaneousPresses;
|
||||
}
|
||||
|
||||
int NoteData::GetNumHands( int iStartIndex, int iEndIndex ) const
|
||||
int NoteData::GetNumRowsWithSimultaneousPresses( int iMinSimultaneousPresses, int iStartIndex, int iEndIndex ) const
|
||||
{
|
||||
/* Count the number of times you have to use your hands. This includes
|
||||
* three taps at the same time, a tap while two hold notes are being held,
|
||||
@@ -524,7 +524,7 @@ int NoteData::GetNumHands( int iStartIndex, int iEndIndex ) const
|
||||
int iNum = 0;
|
||||
FOREACH_NONEMPTY_ROW_ALL_TRACKS_RANGE( *this, r, iStartIndex, iEndIndex )
|
||||
{
|
||||
if( !RowNeedsHands(r) )
|
||||
if( !RowNeedsAtLeastSimultaneousPresses(iMinSimultaneousPresses,r) )
|
||||
continue;
|
||||
|
||||
iNum++;
|
||||
@@ -533,7 +533,7 @@ int NoteData::GetNumHands( int iStartIndex, int iEndIndex ) const
|
||||
return iNum;
|
||||
}
|
||||
|
||||
int NoteData::GetNumN( int iMinTaps, int iStartIndex, int iEndIndex ) const
|
||||
int NoteData::GetNumRowsWithSimultaneousTaps( int iMinTaps, int iStartIndex, int iEndIndex ) const
|
||||
{
|
||||
int iNum = 0;
|
||||
FOREACH_NONEMPTY_ROW_ALL_TRACKS_RANGE( *this, r, iStartIndex, iEndIndex )
|
||||
|
||||
@@ -129,15 +129,23 @@ public:
|
||||
float GetLastBeat() const { return NoteRowToBeat( GetLastRow() ); }
|
||||
int GetNumTapNotes( int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW ) const;
|
||||
int GetNumMines( int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW ) const;
|
||||
int GetNumHands( int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW ) const;
|
||||
int GetNumRowsWithTap( int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW ) const;
|
||||
int GetNumRowsWithTapOrHoldHead( int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW ) const;
|
||||
int GetNumN( int iMinTaps, int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW ) const;
|
||||
// should hands also count as a jump?
|
||||
int GetNumDoubles( int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW ) const { return GetNumN( 2, iStartIndex, iEndIndex ); }
|
||||
/* optimization: for the default of start to end, use the second (faster) */
|
||||
int GetNumHoldNotes( int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW ) const;
|
||||
int RowNeedsHands( int row ) const;
|
||||
|
||||
// Count rows that contain iMinTaps or more taps.
|
||||
int GetNumRowsWithSimultaneousTaps( int iMinTaps, int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW ) const;
|
||||
int GetNumJumps( int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW ) const { return GetNumRowsWithSimultaneousTaps(2,iStartIndex,iEndIndex); }
|
||||
|
||||
// This row needs at least iMinSimultaneousPresses either tapped or held.
|
||||
bool RowNeedsAtLeastSimultaneousPresses( int iMinSimultaneousPresses, int row ) const;
|
||||
bool RowNeedsHands( int row ) const { return RowNeedsAtLeastSimultaneousPresses(2,row); }
|
||||
|
||||
// Count rows that need iMinSimultaneousPresses either tapped or held.
|
||||
int GetNumRowsWithSimultaneousPresses( int iMinSimultaneousPresses, int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW ) const;
|
||||
int GetNumHands( int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW ) const { return GetNumRowsWithSimultaneousPresses(3,iStartIndex,iEndIndex); }
|
||||
int GetNumQuads( int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW ) const { return GetNumRowsWithSimultaneousPresses(4,iStartIndex,iEndIndex); }
|
||||
|
||||
// Transformations
|
||||
void LoadTransformed( const NoteData& original, int iNewNumTracks, const int iOriginalTrackToTakeFrom[] ); // -1 for iOriginalTracksToTakeFrom means no track
|
||||
|
||||
@@ -519,7 +519,7 @@ void NoteDataUtil::GetRadarValues( const NoteData &in, float fSongSeconds, Radar
|
||||
case RADAR_FREEZE: out[rc] = GetFreezeRadarValue( in, fSongSeconds ); break;
|
||||
case RADAR_CHAOS: out[rc] = GetChaosRadarValue( in, fSongSeconds ); break;
|
||||
case RADAR_NUM_TAPS_AND_HOLDS: out[rc] = (float) in.GetNumRowsWithTapOrHoldHead(); break;
|
||||
case RADAR_NUM_JUMPS: out[rc] = (float) in.GetNumDoubles(); break;
|
||||
case RADAR_NUM_JUMPS: out[rc] = (float) in.GetNumJumps(); break;
|
||||
case RADAR_NUM_HOLDS: out[rc] = (float) in.GetNumHoldNotes(); break;
|
||||
case RADAR_NUM_MINES: out[rc] = (float) in.GetNumMines(); break;
|
||||
case RADAR_NUM_HANDS: out[rc] = (float) in.GetNumHands(); break;
|
||||
@@ -569,7 +569,7 @@ float NoteDataUtil::GetAirRadarValue( const NoteData &in, float fSongSeconds )
|
||||
if( !fSongSeconds )
|
||||
return 0.0f;
|
||||
// number of doubles
|
||||
int iNumDoubles = in.GetNumDoubles();
|
||||
int iNumDoubles = in.GetNumJumps();
|
||||
float fReturn = iNumDoubles / fSongSeconds;
|
||||
return min( fReturn, 1.0f );
|
||||
}
|
||||
|
||||
@@ -234,7 +234,7 @@ float GetActualVoltageRadarValue( const NoteData &in, float fSongSeconds, Player
|
||||
|
||||
float GetActualAirRadarValue( const NoteData &in, float fSongSeconds, PlayerNumber pn )
|
||||
{
|
||||
const int iTotalDoubles = in.GetNumDoubles();
|
||||
const int iTotalDoubles = in.GetNumJumps();
|
||||
if( iTotalDoubles == 0 )
|
||||
return 1.0f; // no jumps in song
|
||||
|
||||
|
||||
Reference in New Issue
Block a user