Buecherwurm/Catalogue.cs

36 lines
830 B
C#
Raw Normal View History

2020-04-23 13:44:38 +00:00
using System;
2020-04-23 12:47:50 +00:00
using System.Collections.Generic;
namespace Bücherwurm
{
class Catalogue
{
private List<Book> Books {get; set;}
2020-04-23 13:44:38 +00:00
private int NextId {get; set;}
2020-04-23 12:47:50 +00:00
public Catalogue()
{
Books = new List<Book>();
2020-04-23 13:44:38 +00:00
NextId = 0;
2020-04-23 12:47:50 +00:00
}
public void Import(string JsonString)
{
//TODO: implement!
}
2020-04-23 13:44:38 +00:00
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);
}
2020-04-23 12:47:50 +00:00
}
}