public void Visit(JoinShapes joinShapes) { sb.AppendLine("<figuras>"); joinShapes.Left.Accept(this); joinShapes.Right.Accept(this); sb.AppendLine("</figuras>"); }
static void Main(string[] args) { var shapes = new JoinShapes( left: new Circle(3), right: new Square(10)); var sb = new StringBuilder(); var print = new ShapePrint(); print.Visit(shapes); Console.WriteLine(print.ToString()); }