Files
tp-4-wok/src/Restaurant.java
Minh VU d3f78c7ec1 resto
2024-11-28 10:41:37 +01:00

31 lines
840 B
Java

public class Restaurant {
protected final int MAX_CLIENTS = 25;
private int nbClient = 0;
private Compartiment compPoisson = new Compartiment();
private Compartiment compViande = new Compartiment();
private Compartiment compLegume = new Compartiment();
private Compartiment compNouille = new Compartiment();
Employe_du_buffet employeB = new Employe_du_buffet(compPoisson,compViande,compLegume,compNouille);
public synchronized boolean libre(){
if(nbClient>MAX_CLIENTS){
return false;
}else {
return true;
}
}
public synchronized void ajouterClient(){
if(nbClient<MAX_CLIENTS){
nbClient++;
}
}
public synchronized void diminuerClient(){
if(nbClient<MAX_CLIENTS){
nbClient++;
}
}
}