From 60b23025f52acaad100e9b53728e2c6cbd8cf73a Mon Sep 17 00:00:00 2001 From: maxluli Date: Wed, 25 Jan 2023 22:32:43 +0100 Subject: [PATCH] Added some comments to comply a little bit more with the cfpt rules --- Caisses/Checkout.cs | 12 +++++++++++- Caisses/Client.cs | 15 ++++++++++++--- Caisses/GraphicalCheckout.cs | 12 ++++++++++-- Caisses/GraphicalClient.cs | 11 ++++++++++- Caisses/GraphicalStore.cs | 11 ++++++++++- 5 files changed, 53 insertions(+), 8 deletions(-) diff --git a/Caisses/Checkout.cs b/Caisses/Checkout.cs index 325141a..ceef163 100644 --- a/Caisses/Checkout.cs +++ b/Caisses/Checkout.cs @@ -1,4 +1,13 @@ -using System; +/* + * Rohmer Maxime + * STD Project + * 25/01/2023 + * V1.0 + * Checkout.cs + * Logic base for the checkout object +*/ + +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -23,6 +32,7 @@ namespace Caisses } public void Tick(GraphicalStore store) { + //If enough client are waiting or if they wait in average more than the crossover time, we need to open a new checkout. if (!Open && store.AverageWaitingTime > store.CrossoverTime && store.GetEmptyCheckoutCount() == 0 || store.OpenCheckoutCount == 0 || store.WaitingClients.Count > MAX_CAPACITY * 2 && store.GetEmptyCheckoutCount() == 0) { Open = true; diff --git a/Caisses/Client.cs b/Caisses/Client.cs index e625c61..71218e6 100644 --- a/Caisses/Client.cs +++ b/Caisses/Client.cs @@ -1,4 +1,13 @@ -using System; +/* + * Rohmer Maxime + * STD Project + * 25/01/2023 + * V1.0 + * Client.cs + * Logic base for the client object +*/ + +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -8,8 +17,8 @@ namespace Caisses { public class Client { - public const int MAX_SHOPPING_TIME = 70; //Original 100 - public const int MIN_SHOPPING_TIME = 5; //Original 10 + public const int MAX_SHOPPING_TIME = 100; //Original 100 + public const int MIN_SHOPPING_TIME = 10; //Original 10 public enum ClientState { diff --git a/Caisses/GraphicalCheckout.cs b/Caisses/GraphicalCheckout.cs index d9d95da..46ab29e 100644 --- a/Caisses/GraphicalCheckout.cs +++ b/Caisses/GraphicalCheckout.cs @@ -1,4 +1,13 @@ -using System; +/* + * Rohmer Maxime + * STD Project + * 25/01/2023 + * V1.0 + * GraphicalCheckout.cs + * A graphical override for the checkout object +*/ + +using System; using System.Collections.Generic; using System.Drawing; using System.Linq; @@ -13,7 +22,6 @@ namespace Caisses private Color _color; private Size _size; private Rectangle _area; - private Random Random; public Point Position { get => _position; set => _position = value; } public Color Color { get => _color; set => _color = value; } diff --git a/Caisses/GraphicalClient.cs b/Caisses/GraphicalClient.cs index 9901a38..34b84f3 100644 --- a/Caisses/GraphicalClient.cs +++ b/Caisses/GraphicalClient.cs @@ -1,4 +1,13 @@ -using System; +/* + * Rohmer Maxime + * STD Project + * 25/01/2023 + * V1.0 + * GraphicalClient.cs + * A graphical override for the client object +*/ + +using System; using System.Collections.Generic; using System.Drawing; using System.Linq; diff --git a/Caisses/GraphicalStore.cs b/Caisses/GraphicalStore.cs index 0ad89a5..b2368a2 100644 --- a/Caisses/GraphicalStore.cs +++ b/Caisses/GraphicalStore.cs @@ -1,4 +1,13 @@ -using System; +/* + * Rohmer Maxime + * STD Project + * 25/01/2023 + * V1.0 + * GraphicalStore.cs + * The model of the application that setups all the clients and the checkouts while communicating everything to the vue +*/ + +using System; using System.Collections.Generic; using System.Drawing; using System.Linq;