#ifndef NOTEDATA_H #define NOTEDATA_H /* ----------------------------------------------------------------------------- File: NoteData.h Desc: Holds data about the notes that the player is supposed to hit. NoteData is organized by: track - corresponds to different columns of notes on the screen index - corresponds to subdivisions of beats Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved. Chris Danford ----------------------------------------------------------------------------- */ #include "GameConstantsAndTypes.h" #include "NoteTypes.h" // '1' = tap note // '2' = hold note begin // '3' = hold note end ('1' can also end a HoldNote) ('3' without a matching '2' is ignored // ... for future expansion class NoteData { /* Keep this aligned, so that they all have the same size. */ vector m_TapNotes[MAX_NOTE_TRACKS]; int m_iNumTracks; vector m_HoldNotes; /* Pad m_TapNotes so it includes the row "rows". */ void PadTapNotes(int rows); public: /* Set up to hold the data in From; same number of tracks, same * divisor. Doesn't allocate or copy anything. */ void Config( const NoteData &From ); NoteData(); ~NoteData(); void Init(); int GetNumTracks() const; void SetNumTracks( int iNewNumTracks ); /* Return the note at the given track and row. Row may be out of * range; pretend the song goes on with TAP_EMPTYs indefinitely. */ inline TapNote GetTapNote(unsigned track, unsigned row) const { if(row < 0 || row >= m_TapNotes[track].size()) return TapNote(TAP_EMPTY); return m_TapNotes[track][row]; } void MoveTapNoteTrack(int dest, int src); void SetTapNote(int track, int row, TapNote t); void ClearRange( int iNoteIndexBegin, int iNoteIndexEnd ); void ClearAll(); void CopyRange( NoteData* pFrom, int iFromIndexBegin, int iFromIndexEnd, int iToIndexBegin = -1 ); void CopyAll( NoteData* pFrom ); inline bool IsRowEmpty( int index ) const { for( int t=0; t