static void Main(string[] args) { GameState game = new GameState(); player.SetName(); game.Run(); while (true) { player.Draw(); ConsoleKeyInfo consoleKeyInfo = Console.ReadKey(); if (consoleKeyInfo.Key == ConsoleKey.F2) { Serialize(game); } else if (consoleKeyInfo.Key == ConsoleKey.F3) { game.Stop(); game = Deserialize(); game.Run(); } else { game.ProcessKeyEvent(consoleKeyInfo); } } }
public GameState() { Console.SetWindowSize(40, 42); Console.SetBufferSize(40, 42); Console.CursorVisible = false; player.SetName(); }