Пример #1
0
        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
                    }
                }
            }
        }
Пример #2
0
        /// <summary>
        /// Methodes
        /// </summary>

        public void Pay() //on amene le client au maitre d'hotel et il paye sa commande
        {
            NbrSatisfiedCustomer++;
            var priceToPay = Recipe.Price;

            this.Move(HotelMaster.Instance().GetHomeSquare(), null);
            HotelMaster.Instance().Wallet = HotelMaster.Instance().Wallet + priceToPay;
        }
Пример #3
0
        public static HotelMaster Instance()
        {
            if (_instance == null)
            {
                _instance = new HotelMaster();
            }

            return(_instance);
        }