Example #1
0
 public void BuysBook(Book book)
 {
     OwnedBooks.Add(book);
 }
        private void CreateOwnedBooks()
        {
            OwnedBook book;

            // Neville's books
            book = new OwnedBook()
            {
                Id        = Guid.NewGuid(),
                Available = true,
                Book      = Books[BookType.Who_Am_I],
                Notes     = "Signed special edition."
            };
            Users[UserType.Neville].OwnedBooks.Add(book);
            OwnedBooks.Add(book);
            // Harry's books
            book = new OwnedBook()
            {
                Id        = Guid.NewGuid(),
                Available = true,
                Book      = Books[BookType.Potion_Making],
                Notes     = "Missing pages 31-32."
            };
            Users[UserType.Harry].OwnedBooks.Add(book);
            OwnedBooks.Add(book);
            // Hermione's books
            book = new OwnedBook()
            {
                Id        = Guid.NewGuid(),
                Available = false,
                Book      = Books[BookType.Potion_Making],
                Notes     = "Unabridged version"
            };
            Users[UserType.Hermione].OwnedBooks.Add(book);
            OwnedBooks.Add(book);
            book = new OwnedBook()
            {
                Id        = Guid.NewGuid(),
                Available = true,
                Book      = Books[BookType.Potente_Potions],
                Notes     = "Slightly damp"
            };
            Users[UserType.Hermione].OwnedBooks.Add(book);
            OwnedBooks.Add(book);
            // Ron's books
            book = new OwnedBook()
            {
                Id        = Guid.NewGuid(),
                Available = true,
                Book      = Books[BookType.Potion_Making],
                Notes     = "Unread."
            };
            Users[UserType.Ron].OwnedBooks.Add(book);
            OwnedBooks.Add(book);
            // Ginny's books
            book = new OwnedBook()
            {
                Id        = Guid.NewGuid(),
                Available = false,
                Book      = Books[BookType.Dear_Diary],
                Notes     = "Only copy in the school."
            };
            Users[UserType.Ginny].OwnedBooks.Add(book);
            OwnedBooks.Add(book);
            // Malfoy's books
            book = new OwnedBook()
            {
                Id        = Guid.NewGuid(),
                Available = true,
                Book      = Books[BookType.Basic_Hexes],
                Notes     = ""
            };
            Users[UserType.Malfoy].OwnedBooks.Add(book);
            OwnedBooks.Add(book);
        }