Simplify.

This commit is contained in:
Steve Checkoway
2006-08-23 22:33:08 +00:00
parent 5cfab46c84
commit 8cffb9666f
2 changed files with 4 additions and 13 deletions
-10
View File
@@ -14,21 +14,11 @@
#include "RageUtil_AutoPtr.h" #include "RageUtil_AutoPtr.h"
REGISTER_CLASS_TRAITS( NoteData, new NoteData(*pCopy) ) REGISTER_CLASS_TRAITS( NoteData, new NoteData(*pCopy) )
NoteData::NoteData()
{
Init();
}
void NoteData::Init() void NoteData::Init()
{ {
ClearAll();
m_TapNotes = vector<TrackMap>(); // ensure that the memory is freed m_TapNotes = vector<TrackMap>(); // ensure that the memory is freed
} }
NoteData::~NoteData()
{
}
void NoteData::SetNumTracks( int iNewNumTracks ) void NoteData::SetNumTracks( int iNewNumTracks )
{ {
ASSERT( iNewNumTracks > 0 ); ASSERT( iNewNumTracks > 0 );
+4 -3
View File
@@ -58,13 +58,13 @@ private:
vector<TrackMap> m_TapNotes; vector<TrackMap> m_TapNotes;
public: public:
NoteData();
~NoteData();
void Init(); void Init();
int GetNumTracks() const { return m_TapNotes.size(); } int GetNumTracks() const { return m_TapNotes.size(); }
void SetNumTracks( int iNewNumTracks ); void SetNumTracks( int iNewNumTracks );
bool IsComposite() const; bool IsComposite() const;
bool operator==( const NoteData &nd ) const { return m_TapNotes == nd.m_TapNotes; }
bool operator!=( const NoteData &nd ) const { return m_TapNotes != nd.m_TapNotes; }
/* Return the note at the given track and row. Row may be out of /* Return the note at the given track and row. Row may be out of
* range; pretend the song goes on with TAP_EMPTYs indefinitely. */ * range; pretend the song goes on with TAP_EMPTYs indefinitely. */
@@ -195,7 +195,8 @@ public:
void LoadFromNode( const XNode* pNode ); void LoadFromNode( const XNode* pNode );
}; };
namespace std { namespace std
{
template<> inline void swap<NoteData>( NoteData &nd1, NoteData &nd2 ) { nd1.swap( nd2 ); } template<> inline void swap<NoteData>( NoteData &nd1, NoteData &nd2 ) { nd1.swap( nd2 ); }
} }