コード例 #1
0
 public static void BuyersAndProductsOutput(IntelligentStoreSystem store, List <Buyer> buyers)
 {
     foreach (var buyer in buyers)
     {
         Console.Write(buyer.Name + " can buy: ");
         store.GetsNecessaryProducts(buyer).ToList <string>().ForEach(print => Console.Write(print + "; "));
         Console.WriteLine();
     }
 }
コード例 #2
0
        static void Main(string[] args)
        {
            DiscountStoreSystem    newPriecies  = new DiscountStoreSystem(CreateProducts());
            IntelligentStoreSystem store        = new IntelligentStoreSystem(newPriecies.MakeADiscount());
            List <Buyer>           listOfBuyers = CreateBuyersList();

            BuyersAndProductsOutput(store, listOfBuyers);
            Console.ReadKey();
        }