コード例 #1
0
ファイル: Program.cs プロジェクト: anil0225/AlgoDS
        static void Main(string[] args)
        {
            Invoker       invoker = new Invoker();
            LightReceiver light   = new LightReceiver();

            invoker.AddCommand(new RedColorCommand(light));
            invoker.AddCommand(new SwitchCommand(light));
            invoker.AddCommand(new SwitchCommand(light));
            invoker.AddCommand(new YellowColorCommand(light));
            invoker.AddCommand(new SwitchCommand(light));
            invoker.AddCommand(new SwitchCommand(light));

            invoker.ExecuteCommands();

            Console.ReadLine();
        }