private static Dictionary <Point, double> GeneratePossibleRays(Squad squad, BonusMap map)
        {
            const int angleStep = 6;
            double    radius    = squad.CruisingSpeed * squad.ExpectedTicksToNextUpdate * 1.2;

            radius = Math.Max(radius, 3 * MapCellWidth);

            var squadCenterUnit = squad.CentralUnit;
            var squadCenter     = new Point(squadCenterUnit.X, squadCenterUnit.Y);
            var possibleRays    = new Dictionary <Point, double>();

            for (int angle = 0; angle < 360; angle += angleStep)
            {
                double angleSI             = Math.PI / 180 * angle;
                var    possibleDestination = new Point(squadCenter.X + radius * Math.Sin(angleSI),
                                                       squadCenter.Y + radius * Math.Cos(angleSI));
                if (possibleDestination.X < 0 || possibleDestination.Y < 0 || possibleDestination.X >= 1024 ||
                    possibleDestination.Y >= 1024)
                {
                    continue;
                }
                var cellValuesOnRay = new List <double>();

                for (int i = (int)Math.Min(possibleDestination.X, squadCenter.X);
                     i <= (int)Math.Max(possibleDestination.X, squadCenter.X);
                     i++)
                {
                    for (int j = (int)Math.Min(possibleDestination.Y, squadCenter.Y);
                         j <= (int)Math.Max(possibleDestination.Y, squadCenter.Y);
                         j++)
                    {
                        var worldPoint = new Point(i, j);
                        var isNearRay  =
                            Geom.SegmentCircleIntersects(possibleDestination, squadCenter, worldPoint,
                                                         (double)MapCellWidth / 2);
                        if (isNearRay)
                        {
                            var mapX = (int)Math.Round(i / SizeWorldMapKoeff);
                            var mapY = (int)Math.Round(j / SizeWorldMapKoeff);
                            if (mapX >= 0 && mapY >= 0 && mapX < MapPointsAmount && mapY < MapPointsAmount)
                            {
                                cellValuesOnRay.Add(map.Table[mapX, mapY]);
                            }
                        }
                    }
                }
                if (cellValuesOnRay.Any())
                {
                    possibleRays.Add(possibleDestination, cellValuesOnRay.Average());
                }
                else
                {
                    MyStrategy.Universe.Print($"Warning! Possible ray is null for squad [{squad.Id}]. It is near border.");
                }
            }
            return(possibleRays);
        }