Ejemplo n.º 1
0
        public IEnumerable <PointyRhombPoint> GetEdges()
        {
            PointyRhombPoint edgeAnchor = GetEdgeAnchor();

            return
                (from edgeDirection in EdgeDirections
                 select edgeAnchor.MoveBy(edgeDirection));
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
 public InspectableSplicedVectorPoint(PointyRhombPoint point)
 {
     x     = point.X;
     y     = point.Y;
     index = point.I;
 }
Ejemplo n.º 4
0
 public int DistanceFrom(PointyRhombPoint other)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 5
0
 /**
  *      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)
 {
 }
Ejemplo n.º 6
0
        /**
         *      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));
        }