Added some comments to comply a little bit more with the cfpt rules
This commit is contained in:
+11
-1
@@ -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.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
@@ -23,6 +32,7 @@ namespace Caisses
|
|||||||
}
|
}
|
||||||
public void Tick(GraphicalStore store)
|
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)
|
if (!Open && store.AverageWaitingTime > store.CrossoverTime && store.GetEmptyCheckoutCount() == 0 || store.OpenCheckoutCount == 0 || store.WaitingClients.Count > MAX_CAPACITY * 2 && store.GetEmptyCheckoutCount() == 0)
|
||||||
{
|
{
|
||||||
Open = true;
|
Open = true;
|
||||||
|
|||||||
+12
-3
@@ -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.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
@@ -8,8 +17,8 @@ namespace Caisses
|
|||||||
{
|
{
|
||||||
public class Client
|
public class Client
|
||||||
{
|
{
|
||||||
public const int MAX_SHOPPING_TIME = 70; //Original 100
|
public const int MAX_SHOPPING_TIME = 100; //Original 100
|
||||||
public const int MIN_SHOPPING_TIME = 5; //Original 10
|
public const int MIN_SHOPPING_TIME = 10; //Original 10
|
||||||
|
|
||||||
public enum ClientState
|
public enum ClientState
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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.Collections.Generic;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@@ -13,7 +22,6 @@ namespace Caisses
|
|||||||
private Color _color;
|
private Color _color;
|
||||||
private Size _size;
|
private Size _size;
|
||||||
private Rectangle _area;
|
private Rectangle _area;
|
||||||
private Random Random;
|
|
||||||
|
|
||||||
public Point Position { get => _position; set => _position = value; }
|
public Point Position { get => _position; set => _position = value; }
|
||||||
public Color Color { get => _color; set => _color = value; }
|
public Color Color { get => _color; set => _color = value; }
|
||||||
|
|||||||
@@ -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.Collections.Generic;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|||||||
@@ -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.Collections.Generic;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|||||||
Reference in New Issue
Block a user