예제 #1
0
파일: Program.cs 프로젝트: jonathan93sh/SWD
        static void Main(string[] args)
        {
            BasicFlashlightSTM bfl = new BasicFlashlightSTM(new consoleFlashlight());


            while (true)
            {
                Console.ReadLine();
                bfl.HandleEvent(Event.Power);
            }
        }
예제 #2
0
        static void Main(string[] args)
        {
            BasicFlashlightSTM bfl = new BasicFlashlightSTM(new consoleFlashlight());


            while (true)
            {
                int key = Console.Read();
                if ((char)key == 'p')
                {
                    bfl.HandleEvent(Event.Power);
                }
                else if ((char)key == 'e')
                {
                    bfl.HandleEvent(Event.onEnter);
                }
            }
        }