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); }
public override void GoBuy(ISupermarket supermarket) { Console.WriteLine("{0}去{1}买东西", shoppers.Name, supermarket.GetType().Name); Thread.Sleep(2000); supermarket.Buy(shoppers.Product); }
public Kiosk(ISupermarket _supermarket) : base(_supermarket) { }
public Personal(ISupermarket _supermarket) : base(_supermarket) { }
public Supermarket(ISupermarket _supermarket) { supermarket = _supermarket; }