188using System.Collections.Generic;
A visitor used for ordering items from various shops. The user starts with an instance of this class ...
List< string > ItemsReceived
List of items received from an order/pickup process.
override void VisitBaker(Visitor_Baker shop)
Let the visitor visit a Visitor_Baker shop.
string[] ItemsToOrder
Items to be ordered from any shop that sells the item.
override void VisitPickleGrocer(Visitor_PickleGrocer shop)
Let the visitor visit a Visitor_PickleGrocer shop.
override void VisitButcher(Visitor_Butcher shop)
Let the visitor visit a Visitor_Butcher shop.
override void VisitCondimentGrocer(Visitor_CondimentGrocer shop)
Let the visitor visit a Visitor_CondimentGrocer shop.
override void VisitMaker(Visitor_Maker shop)
Let the visitor visit a Visitor_Maker shop.
OrderVisitor(string[] itemsToOrder)
Constructor.
string ShopNameReceivedFrom
Name of the shop that provided the item(s).
override void VisitVegetableGrocer(Visitor_VegetableGrocer shop)
Let the visitor visit a Visitor_VegetableGrocer shop.
override void VisitRestaurant(Visitor_Restaurant shop)
Let the visitor visit a Visitor_Restaurant shop.
Represent a butcher shop.
Represent a condiment grocer.
Represent a maker (of things).
Represent a pickle grocer.
Represent a restaurant shop.
bool PlaceOrder(string[] items)
Place an order for the specified items. If the inventory is empty, replenish the inventory by visitin...
string Name
Name of the shop.
void PickupOrder(string[] items, List< string > itemsToBePickedUp)
Pick up the items sold by this shop (assumes the items were ordered already). Basically,...
Represent a vegetable grocer.
All visitors must implement this base class and then override one or more of the VisitXXX() methods,...
The namespace containing all Design Pattern Examples implemented in C#.