コード例 #1
0
        private void _auctionCall(IAuction auction)
        {
            AuctionStarter auctionStarter = new AuctionStarter(auction, Agents);

            auctionStarter.startAuction();
            if (auction.AgentsName.Count != 0)
            {
                AuctionManager auctionManager = new AuctionManager(auction);
                Console.WriteLine($"\nThe auction on {auction.Product.Name} starts now!!! The min price is : {auction.BestPrice}");
                auctionManager.Manage();
                _restAgentsFlag();
                try
                {
                    Auctions.RemoveAt(Auctions.IndexOf(auction));
                }
                catch (ArgumentOutOfRangeException ex)
                {
                    Console.WriteLine($"Can't delete {auction.Product.Name} ");
                }
            }
            else
            {
                try
                {
                    Auctions.RemoveAt(Auctions.IndexOf(auction));
                }
                catch (ArgumentOutOfRangeException ex)
                {
                    Console.WriteLine($"Can't delete {auction.Product.Name} ");
                }
            }
        }