Esempio n. 1
0
        private Coordinates SearchingShot()
        {
            Random rand          = new Random(Guid.NewGuid().GetHashCode());
            var    hitNeighbours = FiringBoard.GetHitNeighbours();
            var    neighbourIdx  = rand.Next(hitNeighbours.Count);

            return(hitNeighbours[neighbourIdx]);
        }
Esempio n. 2
0
        public Coordinates FireShot()
        {
            var         hitNeighbours = FiringBoard.GetHitNeighbours();
            Coordinates coords;

            if (hitNeighbours.Any())
            {
                coords = SearchingShot();
            }
            else
            {
                coords = RandomShot();
            }
            return(coords);
        }