From 10a4a972b061985fc27ee092b2b4bf0ebec36fed Mon Sep 17 00:00:00 2001 From: Michael Votaw Date: Tue, 23 Jul 2024 19:26:23 -0500 Subject: [PATCH] Added method to NoteData to get number of mines at given row. --- src/NoteData.cpp | 11 +++++++++++ src/NoteData.h | 3 ++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/NoteData.cpp b/src/NoteData.cpp index 73e023ea2f..a7e8b843cd 100644 --- a/src/NoteData.cpp +++ b/src/NoteData.cpp @@ -545,6 +545,17 @@ int NoteData::GetNumRowsWithTap( int iStartIndex, int iEndIndex ) const return iNumNotes; } +int NoteData::GetNumMinesInRow(int iRow) const +{ + int iNumMines = 0; + for( int t=0; tIsMine(GetTapNote(t, iRow), iRow)) + iNumMines++; + } + return iNumMines; +} + int NoteData::GetNumMines( int iStartIndex, int iEndIndex ) const { int iNumMines = 0; diff --git a/src/NoteData.h b/src/NoteData.h index e6b7f2d755..5486ea6fd4 100644 --- a/src/NoteData.h +++ b/src/NoteData.h @@ -310,7 +310,8 @@ public: int GetNumTapNotes( int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW ) const; int GetNumTapNotesNoTiming( int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW ) const; int GetNumTapNotesInRow( int iRow ) const; - int GetNumMines( int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW ) const; + int GetNumMinesInRow( int iRow ) const; + int GetNumMines( 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; /* Optimization: for the default of start to end, use the second (faster). XXX: Second what? -- Steve */