diff --git a/src/Compartiment.java b/src/Compartiment.java index e196be4..a3a4e11 100644 --- a/src/Compartiment.java +++ b/src/Compartiment.java @@ -1,3 +1,21 @@ -public class Compartiment { - +public class Compartiment{ + protected final int QUANTITE_MAX = 1000; + private int quantite_courant = 0; + + synchronized void remplir(){ + quantite_courant = QUANTITE_MAX; + } + + synchronized void servir(int qte){ + if(qte>quantite_courant){ + + } + else{ + quantite_courant -= qte; + } + } + + public int getQuantite(){ + return quantite_courant; + } } diff --git a/src/Restaurant.java b/src/Restaurant.java index 24a33c5..dd9feac 100644 --- a/src/Restaurant.java +++ b/src/Restaurant.java @@ -1,3 +1,4 @@ public class Restaurant { protected final int MAX_CLIENTS = 25; + private int nbClient = 0; } \ No newline at end of file