Example #1
0
        private Coordinates SearchingShot()
        {
            Random rand         = new Random();
            var    hitNeighbors = Board.GetHitNeighbors();
            var    neighbor     = rand.Next(0, hitNeighbors.Count - 1);

            return(hitNeighbors[neighbor].Coordinates);
        }
Example #2
0
        public Coordinates Shot()
        {
            var         hitNeighbors = Board.GetHitNeighbors();
            Coordinates coordinates;

            if (hitNeighbors.Any())
            {
                coordinates = SearchingShot();
            }
            else
            {
                coordinates = RandomShot();
            }
            return(coordinates);
        }