예제 #1
0
        static void Main(string[] args)
        {
            Console.CursorVisible = false;
            try
            {
                var eventLoop = new EventLoop();
                var game      = new Game("map.txt");

                eventLoop.LeftHandler  += game.OnLeft;
                eventLoop.RightHandler += game.OnRight;
                eventLoop.UpHandler    += game.Up;
                eventLoop.DownHandler  += game.Down;

                eventLoop.Run();
            }
            catch (FileNotFoundException)
            {
                Console.WriteLine("Map file not found");
            }
        }
예제 #2
0
파일: Program.cs 프로젝트: resueman/HW_Sem2
        static void Main()
        {
            try
            {
                var game      = new Game("Map.txt");
                var eventLoop = new EventLoop();

                eventLoop.LeftHandler  += game.OnLeft;
                eventLoop.RightHandler += game.OnRight;
                eventLoop.TopHandler   += game.OnTop;
                eventLoop.DownHandler  += game.OnDown;

                eventLoop.Run();
            }
            catch (FileNotFoundException exception)
            {
                Console.WriteLine(exception.Message);
            }
            catch (IncorrectMapException exception)
            {
                Console.WriteLine(exception.Message);
            }
        }