public bool LoSLine(int xA, int yA, int xB, int yB) { foreach (Point thisPoint in BresLine.RenderLine(new Point(xA, yA), new Point(xB, yB))) { if (!trans[thisPoint.X, thisPoint.Y]) { return(false); } } return(true); }
/// <summary> /// Generates a ray table for LoS calculations. /// </summary> /// <param name="vrange">Maximum view distance.</param> public IEnumerable <IEnumerable <Point> > BuildRayList(int vrange) { Point orig = new Point(0, 0); for (int crange = 2; crange <= vrange; crange++) { IEnumerable <Point> thisrad = rasterCircle(orig, crange); foreach (Point thispoint in thisrad) { yield return(BresLine.RenderLine(orig, thispoint)); } } }