示例#1
0
 public void OnRightTest()
 {
     var eventLoop = new CursorEventLoop();
     var game = new GameWithCursor();
     int position = Console.CursorLeft;
     game.OnRight(new object(), new EventArgs());
     Assert.IsTrue(position + 1 == Console.CursorLeft);
 }
示例#2
0
 /// <summary>
 /// Сборка для игры
 /// </summary>
 /// <param name="args"></param>
 static void Main(string[] args)
 {
     var eventLoop = new CursorEventLoop();
     var game = new GameWithCursor();
     eventLoop.LeftHandler += game.OnLeft;
     eventLoop.RightHandler += game.OnRight;
     eventLoop.UpHandler += game.OnUp;
     eventLoop.DownHandler += game.OnDown;
     eventLoop.Run();
 }