static void Main(string[] args) { var root = new Group{Name = "Root"}; root.Children.Add(new Cube { Name = "A"}); root.Children.Add(new Sphere { Name = "B"}); root.Render(); Console.ReadKey(); }
public void Visit(Group group) { Console.WriteLine("The Group is here " + group.Name); }
static void Main(string[] args) { var root = new Group{Name = "Root"}; root.Children.Add(new Cube { Name = "A"}); root.Children.Add(new Sphere { Name = "B"}); root.Children.Add(new SomeNewGo{ Name = "GO" }); // root.Accept(new RenderingVisitor()); new RenderingVisitor().Traverse(root); Console.ReadKey(); }
public virtual void Visit(Group group) { }