Example #1
0
 public int TakeBook(LibraryBook book)
 {
     if (book.isInStack())
     {
         book.GetFromStack();
         BookList.Add(book);
         return(1);
     }
     return(0);
 }
Example #2
0
File: Program.cs Project: nskr/Lab3
        static void Main(string[] args)
        {
            Console.WriteLine("\nТест создания книги\n");
            LibraryBook newBook = new LibraryBook(BookType.Comedy, 23);

            newBook.PutToStack();
            newBook.GetFromStack();
            Reader newReader = new Reader("Mark", 1312);

            Console.WriteLine("\nТест создания полки\n");
            newBook.PutToStack();
            Console.WriteLine(newReader.TakeBook(newBook));
            Console.WriteLine(newReader.TakeBook(newBook));
            Console.WriteLine(newReader.ReturnBook(newBook));
            Console.WriteLine(newReader.ReturnBook(newBook));
            newReader[0] = newBook;
            newReader[0].PutToStack();
            newReader.Serialize("1.txt");
        }