public IEnumerable <PointyRhombPoint> GetEdges() { PointyRhombPoint edgeAnchor = GetEdgeAnchor(); return (from edgeDirection in EdgeDirections select edgeAnchor.MoveBy(edgeDirection)); }
public static bool DefaultContains(PointyRhombPoint point, int width, int height) { ArrayPoint storagePoint = ArrayPointFromGridPoint(point.BasePoint); return (storagePoint.X >= 0 && storagePoint.X < width && storagePoint.Y >= 0 && storagePoint.Y < height); }
public InspectableSplicedVectorPoint(PointyRhombPoint point) { x = point.X; y = point.Y; index = point.I; }
public int DistanceFrom(PointyRhombPoint other) { throw new NotImplementedException(); }
/** * Construct a new grid whose cells are determined by the given test function. * * The function should only return true for points within the bounds of the rectangle when * the given transforms are applied to them. * * Normally, the static factory methods or shape building methods should be used to create grids. * These constructors are provided for advanced usage. * * @link_constructing_grids */ public PointyRhombGrid(int width, int height, Func <PointyRhombPoint, bool> isInside, PointyRhombPoint offset) : this(width, height, isInside, x => x.MoveBy(offset), x => x.MoveBackBy(offset), PointyRhombPoint.MainDirections) { }
/** * A test function that returns true if the point for which the given * vertexPoint is a vertex, is inside this grid. */ private bool IsInsideEdgeGrid(PointyRhombPoint edgePoint) { var faces = (edgePoint as IEdge <PointyHexPoint>).GetEdgeFaces(); return(faces.Any(Contains)); }