Example #1
0
        private bool ConstructibleSpot(System.Drawing.Point p)
        {
            bool inside;

            if (Helpers.IsInPolygon(Hill, p))
            {
                return(false);                              // cannot build inside
            }
            for (int s = 1; s < Hill.Count(); s++)
            {
                if (Helpers.DistanceToLine(p, Hill[s - 1], Hill[s], out inside) < CONSTRUCTION_ZONE && inside)
                {
                    return(true);
                }
            }
            if (Helpers.DistanceToLine(p, Hill[Hill.Count() - 1], Hill[0], out inside) < CONSTRUCTION_ZONE && inside)
            {
                return(true);
            }
            Console.WriteLine($"Attempt to build non-constructible spot {p}");
            return(false);
        }