Example #1
0
        /// <summary>
        /// Gets first verse number in this book/chapter considering excluded verses.
        /// </summary>
        /// <returns>first verse in the specified book and chapter that is not excluded or
        /// returns <c>null</c> if no included verse left in book</returns>
        public VerseRef?FirstIncludedVerse(int bookNum, int chapterNum)
        {
            do
            {
                int lastVerse = GetLastVerse(bookNum, chapterNum);
                for (int verseNum = 1; verseNum <= lastVerse; verseNum++)
                {
                    if (!IsExcluded(VerseRef.GetBBBCCCVVV(bookNum, chapterNum, verseNum)))
                    {
                        return(new VerseRef(bookNum, chapterNum, verseNum, this));
                    }
                }

                // Non-excluded verse not found in this chapter, so try next chapter
                chapterNum++;
            } while (chapterNum <= GetLastChapter(bookNum));

            return(null);
        }