public VerseReference(int chapter, int verse) { this.Chapter = chapter; this.Verse = verse; QuranStructure.ValidateChapterAndVerse( chapter: chapter, verse: verse ); }
public static void ValidateChapterAndVerse(int chapter, int verse) { if (chapter < 1 || chapter > 114) { throw new ArgumentOutOfRangeException("Chapter"); } if (verse < 1 || verse > QuranStructure.VerseCount(chapter)) { throw new ArgumentOutOfRangeException("Verse"); } }
public VerseRangeReference(int chapter, int firstVerse, int lastVerse) { this.Chapter = chapter; this.FirstVerse = firstVerse; this.LastVerse = lastVerse; QuranStructure.ValidateChapterAndVerse( chapter: chapter, verse: firstVerse ); QuranStructure.ValidateChapterAndVerse( chapter: chapter, verse: lastVerse ); }