first commit because I dont want to lose this project

This commit is contained in:
2023-01-02 11:27:38 +01:00
commit 99aca49290
18 changed files with 1740 additions and 0 deletions
+53
View File
@@ -0,0 +1,53 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Caisses
{
internal class Checkout
{
public const int MAX_CAPACITY = 5;
private List<Client> clients;
private bool open;
private int crossoverTime;
public List<Client> Clients { get => clients; set => clients = value; }
public bool Open { get => open; set => open = value; }
public Checkout()
{
Clients = new List<Client>();
Open = false;
}
public void Tick(int averageWaitingTime, int CrossoverTime)
{
if (!Open && averageWaitingTime > CrossoverTime)
{
Open = true;
}
if (Open && averageWaitingTime < CrossoverTime && Clients.Count == 0)
{
Open = false;
}
/*
if (Clients.Count != 0)
{
//This is the first client inline
Client client = Clients[0];
if (client.State == Client.ClientState.Inline)
client.State = Client.ClientState.Checkout;
if (client.CheckoutTime <= 0)
{
I think we need to do this processing in the store
}
}
*/
}
}
}