static void Main(string[] args) { try { var options = new Options(); if (!Parser.Default.ParseArguments(args, options)) { return; } Console.WriteLine("Starting new game"); var game = new BattleshipsGame(); if (options.ConsoleLogger) { game.Logger = new CombinedLogger(new InMemoryLogger(), new ConsoleLogger()); } game.StartNewGame(options); if (options.Pretty) { Console.ReadLine(); } } catch (Exception ex) { Console.WriteLine(ex); } }
public MainForm() { InitializeComponent(); SetupGrid(dgPlayerShips); SetupGrid(dgComputerShips); _battleshipsGame = new BattleshipsGame(GridSize); }
static void Main(string[] args) { BattleshipsGame game = new BattleshipsGame(); game.Init(new BattleshipsGrid() { Size = 10 }); game.Play(); Console.ReadLine(); }