예제 #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();
 }
예제 #3
0
 public void Initialize()
 {
     eventLoop = new CursorEventLoop();
     game = new CursorGame();
 }