27 lines
563 B
C#
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);
|
|
}
|
|
}
|
|
} |