From 780f9a8c28a72b91f20e20a8068478c85a6ec57a Mon Sep 17 00:00:00 2001 From: maxluli Date: Wed, 11 Jan 2023 15:29:37 +0100 Subject: [PATCH] further optimised checkouts behaviour --- Caisses/GraphicalStore.cs | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/Caisses/GraphicalStore.cs b/Caisses/GraphicalStore.cs index 336854e..db3d52a 100644 --- a/Caisses/GraphicalStore.cs +++ b/Caisses/GraphicalStore.cs @@ -168,26 +168,24 @@ namespace Caisses { NotFullCheckouts.Add(checkout); } - } - } - foreach (GraphicalCheckout checkout in Checkouts) - { - if (checkout.Open && checkout.Clients.Count > 0) - { - Client cClient = checkout.Clients[0]; - if (cClient.State != Client.ClientState.Checkout) - cClient.State = Client.ClientState.Checkout; - - if (cClient.CheckoutTime <= 0) + //Checkout behaviour + if (checkout.Clients.Count > 0) { - checkout.Clients.Remove(cClient); - //We dont load the next because he should be loaded the next time this function is loaded - } + Client cClient = checkout.Clients[0]; + if (cClient.State != Client.ClientState.Checkout) + cClient.State = Client.ClientState.Checkout; - foreach (GraphicalClient ccClient in checkout.Clients) - { - ccClient.Tick(); + if (cClient.CheckoutTime <= 0) + { + checkout.Clients.Remove(cClient); + //We dont load the next because he should be loaded the next time this function is loaded + } + + foreach (GraphicalClient ccClient in checkout.Clients) + { + ccClient.Tick(); + } } } }