Exemple #1
0
        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);
            }
        }
Exemple #2
0
        public MainForm()
        {
            InitializeComponent();
            SetupGrid(dgPlayerShips);
            SetupGrid(dgComputerShips);

            _battleshipsGame = new BattleshipsGame(GridSize);
        }
Exemple #3
0
        static void Main(string[] args)
        {
            BattleshipsGame game = new BattleshipsGame();

            game.Init(new BattleshipsGrid()
            {
                Size = 10
            });
            game.Play();
            Console.ReadLine();
        }