コード例 #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
ファイル: Program.cs プロジェクト: EvgeneDudkin/Homework
 /// <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();
 }