private static bool KeyPressedHandler(ConsoleKeyInfo input_key) { switch (input_key.Key) { case ConsoleKey.Spacebar: tetrisAI.RunDemo(); break; case ConsoleKey.S: tetrisAI.Save(); Console.WriteLine("Network saved!"); break; case ConsoleKey.P: tetrisAI.PauseTraining(); Console.WriteLine("Learning paused!"); break; case ConsoleKey.R: tetrisAI.StartTraining(); Console.WriteLine("Learning resumed!"); break; case ConsoleKey.Escape: return(false); default: break; } return(true); }
private static bool KeyPressedHandler(ConsoleKeyInfo input_key) { switch (input_key.Key) { case ConsoleKey.Spacebar: tetrisAI.RunDemo(); break; case ConsoleKey.N: _game.NextPieceMode = !_game.NextPieceMode; break; case ConsoleKey.Escape: return(false); default: break; } return(true); }