public void Call() { while (true) { this.GroupCustomers(); while (this.WaitingGroups != null) //quand des groupes attendent { ChiefRank goodRankChief = null; foreach (ChiefRank rankChief in this.ChievesRank) //recherche de chef de rang { if (rankChief.ActualSquare == HotelMaster.Instance().GetHomeSquare()) { goodRankChief = rankChief; break; } } if (goodRankChief != null) //on assigne des tables une fois le chef de rang trouvé { List <Customer> group = this.WaitingGroups[0]; this.Welcome(group); // on accueille le groupe Table table = this.AssignTable(group); // on assigne goodRankChief.PlaceCustomers(this.FindSquare(table), table, group); // on ordonne au chef de rang de placer les clients a la bonne table this.WaitingGroups.Remove(this.WaitingGroups[0]); //les clients n'attendent plus } } } }
public void RemoveRankChief(ChiefRank rankChief) { this.ChievesRank.Remove(rankChief); }
public void AddRankChief(ChiefRank rankChief) { this.ChievesRank.Add(rankChief); }