Remove IteratorCondition, use NULL to signify what was previously IteratorCondition::All.
This commit is contained in:
@@ -14,39 +14,6 @@
|
||||
#include "RageUtil_AutoPtr.h"
|
||||
REGISTER_CLASS_TRAITS( NoteData, new NoteData(*pCopy) )
|
||||
|
||||
bool IteratorCondition::TapsHoldsAndMines( const TapNote &tn )
|
||||
{
|
||||
switch( tn.type )
|
||||
{
|
||||
case TapNote::tap:
|
||||
case TapNote::hold_head:
|
||||
case TapNote::mine:
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool IteratorCondition::TapsAndHolds( const TapNote &tn )
|
||||
{
|
||||
switch( tn.type )
|
||||
{
|
||||
case TapNote::tap:
|
||||
case TapNote::hold_head:
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool IteratorCondition::Mines( const TapNote &tn )
|
||||
{
|
||||
return tn.type == TapNote::mine;
|
||||
}
|
||||
|
||||
bool IteratorCondition::All( const TapNote &tn )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
NoteData::NoteData()
|
||||
{
|
||||
Init();
|
||||
@@ -927,7 +894,7 @@ XNode* NoteData::CreateNode() const
|
||||
XNode *p = new XNode;
|
||||
p->m_sName = "NoteData";
|
||||
|
||||
all_tracks_const_iterator iter = GetTapNoteRangeAllTracks( 0, GetLastRow(), IteratorCondition::All );
|
||||
all_tracks_const_iterator iter = GetTapNoteRangeAllTracks( 0, GetLastRow() );
|
||||
|
||||
for( ; !iter.IsAtEnd(); ++iter )
|
||||
{
|
||||
@@ -970,7 +937,7 @@ void NoteData::_all_tracks_iterator<ND, iter, TN>::Find()
|
||||
{
|
||||
m_Iterator = m_NoteData.FindTapNote( m_iTrack, m_iRow );
|
||||
|
||||
if( m_Iterator != m_NoteData.end(m_iTrack) && m_Cond(m_Iterator->second) )
|
||||
if( m_Iterator != m_NoteData.end(m_iTrack) && (!m_Cond || m_Cond(m_Iterator->second)) )
|
||||
return;
|
||||
++m_iTrack;
|
||||
}
|
||||
|
||||
@@ -19,14 +19,6 @@
|
||||
#define FOREACH_NONEMPTY_ROW_ALL_TRACKS_RANGE( nd, row, start, last ) \
|
||||
for( int row = start-1; (nd).GetNextTapNoteRowForAllTracks(row) && row < (last); )
|
||||
|
||||
namespace IteratorCondition
|
||||
{
|
||||
bool TapsHoldsAndMines( const TapNote &tn );
|
||||
bool TapsAndHolds( const TapNote &tn );
|
||||
bool Mines( const TapNote &tn );
|
||||
bool All( const TapNote &tn );
|
||||
}
|
||||
|
||||
class NoteData
|
||||
{
|
||||
public:
|
||||
@@ -101,13 +93,11 @@ public:
|
||||
/* Return an iterator range including exactly iStartRow to iEndRow. */
|
||||
void GetTapNoteRange( int iTrack, int iStartRow, int iEndRow, const_iterator &begin, const_iterator &end ) const;
|
||||
void GetTapNoteRange( int iTrack, int iStartRow, int iEndRow, TrackMap::iterator &begin, TrackMap::iterator &end );
|
||||
all_tracks_iterator GetTapNoteRangeAllTracks( int iStartRow, int iEndRow,
|
||||
IteratorCond cond = IteratorCondition::TapsHoldsAndMines )
|
||||
all_tracks_iterator GetTapNoteRangeAllTracks( int iStartRow, int iEndRow, IteratorCond cond = NULL )
|
||||
{
|
||||
return all_tracks_iterator( *this, iStartRow, iEndRow, cond );
|
||||
}
|
||||
all_tracks_const_iterator GetTapNoteRangeAllTracks( int iStartRow, int iEndRow,
|
||||
IteratorCond cond = IteratorCondition::TapsHoldsAndMines ) const
|
||||
all_tracks_const_iterator GetTapNoteRangeAllTracks( int iStartRow, int iEndRow, IteratorCond cond = NULL) const
|
||||
{
|
||||
return all_tracks_const_iterator( *this, iStartRow, iEndRow, cond );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user