示例#1
0
        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();
        }
示例#2
0
 public void Visit(Group group)
 {
     Console.WriteLine("The Group is here " + group.Name);
 }
示例#3
0
        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();
        }
示例#4
0
 public virtual void Visit(Group group)
 {
 }