示例#1
0
        public override string Process(string[] arguments)
        {
            string output = "";
            string nodeName;

            if (arguments.Length > 1)
            {
                nodeName = arguments[1];
            }
            else
            {
                nodeName = arguments[0];
            }

            switch (arguments[0])
            {
            case "sphere":
                output = new GeometryNode(nodeName).TransformNode.Name;
                break;

            case "box":
                output = new GeometryNode(nodeName).TransformNode.Name;
                break;

            case "light":
                output = new LightNode(nodeName).TransformNode.Name;
                break;
            }

            return("Result: " + output);
        }
示例#2
0
        static void Main(string[] args)
        {
            TransformNode sphereNode = new GeometryNode("sphere").TransformNode;
            TransformNode lightNode  = new LightNode("spotLight").TransformNode;

            TransformNode.Group(lightNode, sphereNode);
            TransformNode.ShowAll();

            while (!CommandManager.Done)
            {
                Console.Write(":");
                CommandManager.ProcessCommand(Console.ReadLine());
            }
        }