Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            var eventLoop = new EventLoop();

            using (var sw = new StreamWriter("test.txt"))
            {
                sw.Write(@"## ##
#@  #
##   
     
# # #");
            }

            var controller = new CursorController(@"test.txt", Console.SetCursorPosition);

            File.Delete("test.txt");

            eventLoop.LeftHandler  += controller.OnLeft;
            eventLoop.RightHandler += controller.OnRight;
            eventLoop.UpHandler    += controller.OnUp;
            eventLoop.DownHandler  += controller.OnDown;

            controller.Print();

            eventLoop.Run();
        }
Ejemplo n.º 2
0
        public void Setup()
        {
            using (var sw = new StreamWriter("test.txt"))
            {
                sw.Write(@"#####
#   #
# @ #
#    
#####");
            }

            controller = new CursorController(@"test.txt", (int a, int b) => { });
            map        = new Map(@"test.txt");

            File.Delete("test.txt");
        }