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

27 lines
563 B
C#

using System.Collections.Generic;
namespace Bücherwurm
{
class Inventory
{
private List<Item> InventoryList {get; set;}
private int NextId {get; set;}
public Inventory(){
InventoryList = new List<Item>();
NextId = 0;
}
public void Add(Book Book)
{
InventoryList.Add(new Item(NextId, Book.BookId));
NextId = NextId++;
}
public void Remove(int Id)
{
InventoryList.RemoveAll(item => item.ItemId == Id);
}
}
}