Esempio n. 1
0
        /// <summary>
        ///		Starts the whole prosess of creating threads of customers and stores
        /// </summary>
        public void StartBazaar()
        {
            _threadHandler.StartAllStoresThreads(_bazaar);

            if (_bazaar.IsBazarOpen())
            {
                _threadHandler.StartAllCustomerThreads(_bank, _bazaar);

                while (_bazaar.IsBazarOpen())
                {
                    _threadHandler.GenerateExtraCustomers(_bank, _bazaar);
                }
                EndOfDay();

                Console.WriteLine("---------------------");
                Console.WriteLine("Bazaar is now closed.");
                Console.WriteLine("---------------------");
            }
        }