示例#1
0
        static void Main(string[] args)
        {
            Console.WriteLine("***Facade Pattern Demo");
            RobotFacade rf1 = new RobotFacade();

            rf1.ConstructMilanoRobot();
            RobotFacade rf2 = new RobotFacade();

            rf2.ConstructRobonautRobot();
            rf1.DestroyMilanoRobot();
            rf2.DestroyRobonautRobot();
        }
        static void Main(string[] args)
        {
            RobotFacade facade = new RobotFacade();

            facade.start();
            facade.MoveForward(2);
            facade.MoveBackward(2);
            facade.MoveToRight(2);
            facade.MoveToLeft(2);

            facade.SpeakMessage("I'm here");

            facade.MoveBottomLeft(2);
            facade.MoveBottomRight(2);
            facade.MoveTopRight(2);
            facade.MoveTopLeft(2);

            facade.stop();
        }