/// <summary> /// Remove all the books in the "other" BookSet from this BookSet. /// </summary> /// <param name="other"></param> public void Remove(BookSet other) { foreach (int bookNum in other.SelectedBookNumbers) { Remove(bookNum); } }
public void Add(BookSet other) { foreach (int bookNum in other.SelectedBookNumbers) { Add(bookNum); } }
public override bool Equals(object obj) { BookSet other = (obj as BookSet); if (other == null) { return(false); } return(selected.SequenceEqual(other.selected)); }
/// <summary> /// Creates a book set containing books in verses /// </summary> public static BookSet CreateBookSetFromRefs(IEnumerable <VerseRef> verseRefs) { BookSet books = new BookSet(); foreach (var verseRef in verseRefs) { books.Add(verseRef.BookNum); } return(books); }
/// <summary> /// Intersects two book sets /// </summary> /// <param name="other"></param> /// <returns>books that are present in both</returns> public BookSet Intersect(BookSet other) { BookSet bookSet = new BookSet(); foreach (int bookNum in other.SelectedBookNumbers) { if (IsSelected(bookNum)) { bookSet.Add(bookNum); } } return(bookSet); }
public BookSet(BookSet bset) { Books = bset.Books; }