Example #1
0
 private void button_GeneretaRandom_Click(object sender, EventArgs e)
 {
     FieldGenerator.GenerateRandomField(ref game.Player.board, ref game.Player.ships);
     button1.Enabled = true;
     //InitGrid(enemyGrid);
     //Drawer.DrawPlayerBoard(game.Player.EnemyBoard, enemyGrid);
     Drawer.DrawPlayerBoard(game.Player.Board, gridPlayer);
 }
Example #2
0
        public ComputerPlayer()
        {
            InitializeBoards();
            AvailablePointForShooting = new List <Point>();
            Ships = new List <Ship>();

            FieldGenerator.GenerateRandomField(ref board, ref ships);

            for (int i = 0; i < Settings.FIELD_SIZE; i++)
            {
                for (int j = 0; j < Settings.FIELD_SIZE; j++)
                {
                    AvailablePointForShooting.Add(new Point(i, j));
                }
            }

            rnd = new Random();
            SelectNextTargetPoint();
        }