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

32 lines
752 B
C#

using System.Collections.Generic;
namespace Bücherwurm
{
class Lend_Administration
{
private List<Lending> Lendings {get; set;}
private List<int> ActiveLendings {get; set;}
private int NextId {get; set;}
public Lend_Administration()
{
Lendings = new List<Lending>();
ActiveLendings = new List<int>();
NextId = 0;
}
public void Lend(int[] ItemIds, string Customer)
{
Lendings.Add(new Lending(NextId, ItemIds, Customer));
ActiveLendings.Add(NextId);
NextId = NextId++;
}
public void Return(int LendID)
{
ActiveLendings.RemoveAll(id => id == LendID);
}
}
}