Пример #1
0
        private static void RunVisitor()
        {
            Visitor.Tobacco tobacco = new Visitor.Tobacco();
            Visitor.Necessity neccesity = new Visitor.Necessity();
            Visitor.Liquor liquor = new Visitor.Liquor();

            Visitor.SpeccyVisitor speccy = new Visitor.SpeccyVisitor();
            Visitor.SpeccySpeccy speccySpeccy = new Visitor.SpeccySpeccy();

            speccy.visit(tobacco);
            speccySpeccy.visit(neccesity);
            speccy.visit(liquor);
        }
Пример #2
0
 public void visit(Tobacco tobaccoItem)
 {
     Console.Write("Keep quiet" + tobaccoItem.GetType().Attributes.ToString());
 }