Buecherwurm/Catalogue.cs
2020-04-23 15:44:38 +02:00

36 lines
830 B
C#

using System;
using System.Collections.Generic;
namespace Bücherwurm
{
class Catalogue
{
private List<Book> Books {get; set;}
private int NextId {get; set;}
public Catalogue()
{
Books = new List<Book>();
NextId = 0;
}
public void Import(string JsonString)
{
//TODO: implement!
}
public void Add(string Title, string Author,
string Country, string ILink, string Link,
string Language, int Pages, int Year)
{
Books.Add(new Book(NextId, Title, Author, Country, ILink, Link, Language, Pages, Year));
NextId = NextId++;
}
public void Remove(int BookID)
{
Books.RemoveAll(book => book.BookId == BookID);
}
}
}