Beispiel #1
0
 public void printLiterature()
 {
     for (int i = 0; i < Literature.Count; i++)
     {
         Literature current = Literature[i];
         if (!current.CheckedOut)
         {
             if (current is Book)
             {
                 Book book = (Book)current;
                 Console.WriteLine($"{i + 1}. {book.Title} by {book.Author}, Fiction: {book.Fiction} \n Description: {book.Desc} (Book)");
             }
             if (current is Magazine)
             {
                 Magazine magazine = (Magazine)current;
                 Console.WriteLine($"{i + 1}. {magazine.Title} by {magazine.Author}, {magazine.Publisher} \n Description: {magazine.Desc} (Magazine)");
             }
         }
     }
 }
Beispiel #2
0
 public void AddMagazine(Magazine magazine)
 {
     Magazines.Add(magazine);
     Literature.Add(magazine);
 }