Esempio n. 1
0
        private static void InitScenario()
        {
            supermarket = new DefaultSupermarket();
            customer    = new DefaultCustomer();
            AddDefaultSupplier();
            ISupplier s = Marketplace.GetInstance().FindSupplier(new DefaultItem("Banana", 0.5));

            supermarket.OrderItems(new DefaultItem("Banana", 0.5), 100);
            supermarket.OrderItems(new DefaultItem("Apple", 0.3), 100);
            supermarket.OrderItems(new DefaultItem("Coconut", 3.5), 100);
        }
Esempio n. 2
0
 public override void GoBuy(ISupermarket supermarket)
 {
     Console.WriteLine("{0}去{1}买东西", shoppers.Name, supermarket.GetType().Name);
     Thread.Sleep(2000);
     supermarket.Buy(shoppers.Product);
 }
Esempio n. 3
0
 public Kiosk(ISupermarket _supermarket) : base(_supermarket)
 {
 }
Esempio n. 4
0
 public Personal(ISupermarket _supermarket) : base(_supermarket)
 {
 }
Esempio n. 5
0
 public Supermarket(ISupermarket _supermarket)
 {
     supermarket = _supermarket;
 }