Enums for TapNoteType, TapNoteSubType, and TapNoteSource
I intend to make additional useful information available on judgments, such as TapNoteType and TapNoteSubType( for hold judgments ). I am submitting this part as a separate pull request because it is more generally applicable to anything TapNote related.
This commit is contained in:
+55
-55
@@ -91,7 +91,7 @@ void NoteData::ClearRangeForTrack( int rowBegin, int rowEnd, int iTrack )
|
||||
--prev;
|
||||
TapNote tn = lBegin->second;
|
||||
int iRow = prev->first;
|
||||
if( tn.type == TapNote::hold_head && iRow + tn.iDuration > rowEnd )
|
||||
if( tn.type == TapNoteType_HoldHead && iRow + tn.iDuration > rowEnd )
|
||||
{
|
||||
// A hold note overlaps the end of the range. Separate it.
|
||||
SetTapNote( iTrack, iRow, TAP_EMPTY );
|
||||
@@ -144,10 +144,10 @@ void NoteData::CopyRange( const NoteData& from, int rowFromBegin, int rowFromEnd
|
||||
for( ; lBegin != lEnd; ++lBegin )
|
||||
{
|
||||
TapNote head = lBegin->second;
|
||||
if( head.type == TapNote::empty )
|
||||
if( head.type == TapNoteType_Empty )
|
||||
continue;
|
||||
|
||||
if( head.type == TapNote::hold_head )
|
||||
if( head.type == TapNoteType_HoldHead )
|
||||
{
|
||||
int iStartRow = lBegin->first + iMoveBy;
|
||||
int iEndRow = iStartRow + head.iDuration;
|
||||
@@ -175,7 +175,7 @@ void NoteData::CopyAll( const NoteData& from )
|
||||
bool NoteData::IsRowEmpty( int row ) const
|
||||
{
|
||||
for( int t=0; t<GetNumTracks(); t++ )
|
||||
if( GetTapNote(t, row).type != TapNote::empty )
|
||||
if( GetTapNote(t, row).type != TapNoteType_Empty )
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
@@ -185,7 +185,7 @@ bool NoteData::IsRangeEmpty( int track, int rowBegin, int rowEnd ) const
|
||||
ASSERT( track < GetNumTracks() );
|
||||
|
||||
FOREACH_NONEMPTY_ROW_IN_TRACK_RANGE( *this, track, r, rowBegin, rowEnd )
|
||||
if( GetTapNote(track,r).type != TapNote::empty )
|
||||
if( GetTapNote(track,r).type != TapNoteType_Empty )
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
@@ -194,7 +194,7 @@ int NoteData::GetNumTapNonEmptyTracks( int row ) const
|
||||
{
|
||||
int iNum = 0;
|
||||
for( int t=0; t<GetNumTracks(); t++ )
|
||||
if( GetTapNote(t, row).type != TapNote::empty )
|
||||
if( GetTapNote(t, row).type != TapNoteType_Empty )
|
||||
iNum++;
|
||||
return iNum;
|
||||
}
|
||||
@@ -202,7 +202,7 @@ int NoteData::GetNumTapNonEmptyTracks( int row ) const
|
||||
void NoteData::GetTapNonEmptyTracks( int row, set<int>& addTo ) const
|
||||
{
|
||||
for( int t=0; t<GetNumTracks(); t++ )
|
||||
if( GetTapNote(t, row).type != TapNote::empty )
|
||||
if( GetTapNote(t, row).type != TapNoteType_Empty )
|
||||
addTo.insert(t);
|
||||
}
|
||||
|
||||
@@ -210,7 +210,7 @@ bool NoteData::GetTapFirstNonEmptyTrack( int row, int &iNonEmptyTrackOut ) const
|
||||
{
|
||||
for( int t=0; t<GetNumTracks(); t++ )
|
||||
{
|
||||
if( GetTapNote( t, row ).type != TapNote::empty )
|
||||
if( GetTapNote( t, row ).type != TapNoteType_Empty )
|
||||
{
|
||||
iNonEmptyTrackOut = t;
|
||||
return true;
|
||||
@@ -223,7 +223,7 @@ bool NoteData::GetTapFirstEmptyTrack( int row, int &iEmptyTrackOut ) const
|
||||
{
|
||||
for( int t=0; t<GetNumTracks(); t++ )
|
||||
{
|
||||
if( GetTapNote( t, row ).type == TapNote::empty )
|
||||
if( GetTapNote( t, row ).type == TapNoteType_Empty )
|
||||
{
|
||||
iEmptyTrackOut = t;
|
||||
return true;
|
||||
@@ -236,7 +236,7 @@ bool NoteData::GetTapLastEmptyTrack( int row, int &iEmptyTrackOut ) const
|
||||
{
|
||||
for( int t=GetNumTracks()-1; t>=0; t-- )
|
||||
{
|
||||
if( GetTapNote( t, row ).type == TapNote::empty )
|
||||
if( GetTapNote( t, row ).type == TapNoteType_Empty )
|
||||
{
|
||||
iEmptyTrackOut = t;
|
||||
return true;
|
||||
@@ -251,7 +251,7 @@ int NoteData::GetNumTracksWithTap( int row ) const
|
||||
for( int t=0; t<GetNumTracks(); t++ )
|
||||
{
|
||||
const TapNote &tn = GetTapNote( t, row );
|
||||
if( tn.type == TapNote::tap || tn.type == TapNote::lift )
|
||||
if( tn.type == TapNoteType_Tap || tn.type == TapNoteType_Lift )
|
||||
iNum++;
|
||||
}
|
||||
return iNum;
|
||||
@@ -263,7 +263,7 @@ int NoteData::GetNumTracksWithTapOrHoldHead( int row ) const
|
||||
for( int t=0; t<GetNumTracks(); t++ )
|
||||
{
|
||||
const TapNote &tn = GetTapNote( t, row );
|
||||
if( tn.type == TapNote::tap || tn.type == TapNote::lift || tn.type == TapNote::hold_head )
|
||||
if( tn.type == TapNoteType_Tap || tn.type == TapNoteType_Lift || tn.type == TapNoteType_HoldHead )
|
||||
iNum++;
|
||||
}
|
||||
return iNum;
|
||||
@@ -274,7 +274,7 @@ int NoteData::GetFirstTrackWithTap( int row ) const
|
||||
for( int t=0; t<GetNumTracks(); t++ )
|
||||
{
|
||||
const TapNote &tn = GetTapNote( t, row );
|
||||
if( tn.type == TapNote::tap || tn.type == TapNote::lift )
|
||||
if( tn.type == TapNoteType_Tap || tn.type == TapNoteType_Lift )
|
||||
return t;
|
||||
}
|
||||
return -1;
|
||||
@@ -285,7 +285,7 @@ int NoteData::GetFirstTrackWithTapOrHoldHead( int row ) const
|
||||
for( int t=0; t<GetNumTracks(); t++ )
|
||||
{
|
||||
const TapNote &tn = GetTapNote( t, row );
|
||||
if( tn.type == TapNote::tap || tn.type == TapNote::lift || tn.type == TapNote::hold_head )
|
||||
if( tn.type == TapNoteType_Tap || tn.type == TapNoteType_Lift || tn.type == TapNoteType_HoldHead )
|
||||
return t;
|
||||
}
|
||||
return -1;
|
||||
@@ -296,7 +296,7 @@ int NoteData::GetLastTrackWithTapOrHoldHead( int row ) const
|
||||
for( int t=GetNumTracks()-1; t>=0; t-- )
|
||||
{
|
||||
const TapNote &tn = GetTapNote( t, row );
|
||||
if( tn.type == TapNote::tap || tn.type == TapNote::lift || tn.type == TapNote::hold_head )
|
||||
if( tn.type == TapNoteType_Tap || tn.type == TapNoteType_Lift || tn.type == TapNoteType_HoldHead )
|
||||
return t;
|
||||
}
|
||||
return -1;
|
||||
@@ -316,7 +316,7 @@ void NoteData::AddHoldNote( int iTrack, int iStartRow, int iEndRow, TapNote tn )
|
||||
{
|
||||
int iOtherRow = it->first;
|
||||
const TapNote &tnOther = it->second;
|
||||
if( tnOther.type == TapNote::hold_head )
|
||||
if( tnOther.type == TapNoteType_HoldHead )
|
||||
{
|
||||
iStartRow = min( iStartRow, iOtherRow );
|
||||
iEndRow = max( iEndRow, iOtherRow + tnOther.iDuration );
|
||||
@@ -349,7 +349,7 @@ void NoteData::AddHoldNote( int iTrack, int iStartRow, int iEndRow, TapNote tn )
|
||||
bool NoteData::IsHoldHeadOrBodyAtRow( int iTrack, int iRow, int *pHeadRow ) const
|
||||
{
|
||||
const TapNote &tn = GetTapNote( iTrack, iRow );
|
||||
if( tn.type == TapNote::hold_head )
|
||||
if( tn.type == TapNoteType_HoldHead )
|
||||
{
|
||||
if( pHeadRow != NULL )
|
||||
*pHeadRow = iRow;
|
||||
@@ -369,7 +369,7 @@ bool NoteData::IsHoldNoteAtRow( int iTrack, int iRow, int *pHeadRow ) const
|
||||
if( pHeadRow == NULL )
|
||||
pHeadRow = &iDummy;
|
||||
|
||||
/* Starting at iRow, search upwards. If we find a TapNote::hold_head, we're within
|
||||
/* Starting at iRow, search upwards. If we find a TapNoteType_HoldHead, we're within
|
||||
* a hold. If we find a tap, mine or attack, we're not--those never lie
|
||||
* within hold notes. Ignore autoKeysound. */
|
||||
FOREACH_NONEMPTY_ROW_IN_TRACK_RANGE_REVERSE( *this, iTrack, r, 0, iRow )
|
||||
@@ -377,21 +377,21 @@ bool NoteData::IsHoldNoteAtRow( int iTrack, int iRow, int *pHeadRow ) const
|
||||
const TapNote &tn = GetTapNote( iTrack, r );
|
||||
switch( tn.type )
|
||||
{
|
||||
case TapNote::hold_head:
|
||||
case TapNoteType_HoldHead:
|
||||
if( tn.iDuration + r < iRow )
|
||||
return false;
|
||||
*pHeadRow = r;
|
||||
return true;
|
||||
|
||||
case TapNote::tap:
|
||||
case TapNote::mine:
|
||||
case TapNote::attack:
|
||||
case TapNote::lift:
|
||||
case TapNote::fake:
|
||||
case TapNoteType_Tap:
|
||||
case TapNoteType_Mine:
|
||||
case TapNoteType_Attack:
|
||||
case TapNoteType_Lift:
|
||||
case TapNoteType_Fake:
|
||||
return false;
|
||||
|
||||
case TapNote::empty:
|
||||
case TapNote::autoKeysound:
|
||||
case TapNoteType_Empty:
|
||||
case TapNoteType_AutoKeysound:
|
||||
// ignore
|
||||
continue;
|
||||
DEFAULT_FAIL( tn.type );
|
||||
@@ -450,7 +450,7 @@ int NoteData::GetLastRow() const
|
||||
/* XXX: We might have a hold note near the end with autoplay sounds
|
||||
* after it. Do something else with autoplay sounds ... */
|
||||
const TapNote &tn = GetTapNote( t, iRow );
|
||||
if( tn.type == TapNote::hold_head )
|
||||
if( tn.type == TapNoteType_HoldHead )
|
||||
iRow += tn.iDuration;
|
||||
|
||||
iOldestRowFoundSoFar = max( iOldestRowFoundSoFar, iRow );
|
||||
@@ -461,27 +461,27 @@ int NoteData::GetLastRow() const
|
||||
|
||||
bool NoteData::IsTap(const TapNote &tn, const int row) const
|
||||
{
|
||||
return (tn.type != TapNote::empty && tn.type != TapNote::mine
|
||||
&& tn.type != TapNote::lift && tn.type != TapNote::fake
|
||||
&& tn.type != TapNote::autoKeysound
|
||||
return (tn.type != TapNoteType_Empty && tn.type != TapNoteType_Mine
|
||||
&& tn.type != TapNoteType_Lift && tn.type != TapNoteType_Fake
|
||||
&& tn.type != TapNoteType_AutoKeysound
|
||||
&& GAMESTATE->GetProcessedTimingData()->IsJudgableAtRow(row));
|
||||
}
|
||||
|
||||
bool NoteData::IsMine(const TapNote &tn, const int row) const
|
||||
{
|
||||
return (tn.type == TapNote::mine
|
||||
return (tn.type == TapNoteType_Mine
|
||||
&& GAMESTATE->GetProcessedTimingData()->IsJudgableAtRow(row));
|
||||
}
|
||||
|
||||
bool NoteData::IsLift(const TapNote &tn, const int row) const
|
||||
{
|
||||
return (tn.type == TapNote::lift
|
||||
return (tn.type == TapNoteType_Lift
|
||||
&& GAMESTATE->GetProcessedTimingData()->IsJudgableAtRow(row));
|
||||
}
|
||||
|
||||
bool NoteData::IsFake(const TapNote &tn, const int row) const
|
||||
{
|
||||
return (tn.type == TapNote::fake
|
||||
return (tn.type == TapNoteType_Fake
|
||||
|| !GAMESTATE->GetProcessedTimingData()->IsJudgableAtRow(row));
|
||||
}
|
||||
|
||||
@@ -553,11 +553,11 @@ bool NoteData::RowNeedsAtLeastSimultaneousPresses( int iMinSimultaneousPresses,
|
||||
const TapNote &tn = GetTapNote(t, row);
|
||||
switch( tn.type )
|
||||
{
|
||||
case TapNote::mine:
|
||||
case TapNote::empty:
|
||||
case TapNote::fake:
|
||||
case TapNote::lift: // you don't "press" on a lift.
|
||||
case TapNote::autoKeysound:
|
||||
case TapNoteType_Mine:
|
||||
case TapNoteType_Empty:
|
||||
case TapNoteType_Fake:
|
||||
case TapNoteType_Lift: // you don't "press" on a lift.
|
||||
case TapNoteType_AutoKeysound:
|
||||
continue; // skip these types - they don't count
|
||||
default: break;
|
||||
}
|
||||
@@ -612,10 +612,10 @@ int NoteData::GetNumRowsWithSimultaneousTaps( int iMinTaps, int iStartIndex, int
|
||||
for( int t=0; t<GetNumTracks(); t++ )
|
||||
{
|
||||
const TapNote &tn = GetTapNote(t, r);
|
||||
if (tn.type != TapNote::mine && // mines don't count.
|
||||
tn.type != TapNote::empty &&
|
||||
tn.type != TapNote::fake &&
|
||||
tn.type != TapNote::autoKeysound)
|
||||
if (tn.type != TapNoteType_Mine && // mines don't count.
|
||||
tn.type != TapNoteType_Empty &&
|
||||
tn.type != TapNoteType_Fake &&
|
||||
tn.type != TapNoteType_AutoKeysound)
|
||||
iNumNotesThisIndex++;
|
||||
}
|
||||
if( iNumNotesThisIndex >= iMinTaps )
|
||||
@@ -634,8 +634,8 @@ int NoteData::GetNumHoldNotes( int iStartIndex, int iEndIndex ) const
|
||||
GetTapNoteRangeExclusive( t, iStartIndex, iEndIndex, lBegin, lEnd );
|
||||
for( ; lBegin != lEnd; ++lBegin )
|
||||
{
|
||||
if( lBegin->second.type != TapNote::hold_head ||
|
||||
lBegin->second.subType != TapNote::hold_head_hold )
|
||||
if( lBegin->second.type != TapNoteType_HoldHead ||
|
||||
lBegin->second.subType != TapNoteSubType_Hold )
|
||||
continue;
|
||||
if (!GAMESTATE->GetProcessedTimingData()->IsJudgableAtRow(lBegin->first))
|
||||
continue;
|
||||
@@ -654,8 +654,8 @@ int NoteData::GetNumRolls( int iStartIndex, int iEndIndex ) const
|
||||
GetTapNoteRangeExclusive( t, iStartIndex, iEndIndex, lBegin, lEnd );
|
||||
for( ; lBegin != lEnd; ++lBegin )
|
||||
{
|
||||
if( lBegin->second.type != TapNote::hold_head ||
|
||||
lBegin->second.subType != TapNote::hold_head_roll )
|
||||
if( lBegin->second.type != TapNoteType_HoldHead ||
|
||||
lBegin->second.subType != TapNoteSubType_Roll )
|
||||
continue;
|
||||
if (!GAMESTATE->GetProcessedTimingData()->IsJudgableAtRow(lBegin->first))
|
||||
continue;
|
||||
@@ -773,8 +773,8 @@ pair<int, int> NoteData::GetNumHoldNotesTwoPlayer( int iStartIndex, int iEndInde
|
||||
GetTapNoteRangeExclusive( t, iStartIndex, iEndIndex, lBegin, lEnd );
|
||||
for( ; lBegin != lEnd; ++lBegin )
|
||||
{
|
||||
if( lBegin->second.type != TapNote::hold_head ||
|
||||
lBegin->second.subType != TapNote::hold_head_hold )
|
||||
if( lBegin->second.type != TapNoteType_HoldHead ||
|
||||
lBegin->second.subType != TapNoteSubType_Hold )
|
||||
continue;
|
||||
if (!GAMESTATE->GetProcessedTimingData()->IsJudgableAtRow(lBegin->first))
|
||||
continue;
|
||||
@@ -816,8 +816,8 @@ pair<int, int> NoteData::GetNumRollsTwoPlayer( int iStartIndex, int iEndIndex )
|
||||
GetTapNoteRangeExclusive( t, iStartIndex, iEndIndex, lBegin, lEnd );
|
||||
for( ; lBegin != lEnd; ++lBegin )
|
||||
{
|
||||
if( lBegin->second.type != TapNote::hold_head ||
|
||||
lBegin->second.subType != TapNote::hold_head_roll )
|
||||
if( lBegin->second.type != TapNoteType_HoldHead ||
|
||||
lBegin->second.subType != TapNoteSubType_Roll )
|
||||
continue;
|
||||
if (!GAMESTATE->GetProcessedTimingData()->IsJudgableAtRow(lBegin->first))
|
||||
continue;
|
||||
@@ -880,8 +880,8 @@ int NoteData::GetNumMinefields( int iStartIndex, int iEndIndex ) const
|
||||
GetTapNoteRangeExclusive( t, iStartIndex, iEndIndex, begin, end );
|
||||
for( ; begin != end; ++begin )
|
||||
{
|
||||
if( begin->second.type != TapNote::hold_head ||
|
||||
begin->second.subType != TapNote::hold_head_mine )
|
||||
if( begin->second.type != TapNoteType_HoldHead ||
|
||||
begin->second.subType != TapNoteSubType_mine )
|
||||
continue;
|
||||
iNumMinefields++;
|
||||
}
|
||||
@@ -1033,7 +1033,7 @@ void NoteData::GetTapNoteRangeInclusive( int iTrack, int iStartRow, int iEndRow,
|
||||
iterator prev = Decrement(lBegin);
|
||||
|
||||
const TapNote &tn = prev->second;
|
||||
if( tn.type == TapNote::hold_head )
|
||||
if( tn.type == TapNoteType_HoldHead )
|
||||
{
|
||||
int iHoldStartRow = prev->first;
|
||||
int iHoldEndRow = iHoldStartRow + tn.iDuration;
|
||||
@@ -1052,7 +1052,7 @@ void NoteData::GetTapNoteRangeInclusive( int iTrack, int iStartRow, int iEndRow,
|
||||
// Include the next note if it's a hold and starts on iEndRow.
|
||||
const TapNote &tn = lEnd->second;
|
||||
int iHoldStartRow = lEnd->first;
|
||||
if( tn.type == TapNote::hold_head && iHoldStartRow == iEndRow )
|
||||
if( tn.type == TapNoteType_HoldHead && iHoldStartRow == iEndRow )
|
||||
++lEnd;
|
||||
}
|
||||
}
|
||||
@@ -1066,7 +1066,7 @@ void NoteData::GetTapNoteRangeExclusive( int iTrack, int iStartRow, int iEndRow,
|
||||
{
|
||||
iterator prev = lEnd;
|
||||
--prev;
|
||||
if( prev->second.type == TapNote::hold_head )
|
||||
if( prev->second.type == TapNoteType_HoldHead )
|
||||
{
|
||||
int localStartRow = prev->first;
|
||||
const TapNote &tn = prev->second;
|
||||
|
||||
Reference in New Issue
Block a user