Esempio n. 1
0
        public static bool DefaultContains(FlatRhombPoint point, int width, int height)
        {
            ArrayPoint storagePoint = ArrayPointFromGridPoint(point.BasePoint);

            return
                (storagePoint.X >= 0 &&
                 storagePoint.X < width &&
                 storagePoint.Y >= 0 &&
                 storagePoint.Y < height);
        }
Esempio n. 2
0
 public InspectableSplicedVectorPoint(FlatRhombPoint point)
 {
     x     = point.X;
     y     = point.Y;
     index = point.I;
 }
Esempio n. 3
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 FlatRhombGrid(int width, int height, Func <FlatRhombPoint, bool> isInside, FlatRhombPoint offset) :
     this(width, height, isInside, x => x.MoveBy(offset), x => x.MoveBackBy(offset), FlatRhombPoint.MainDirections)
 {
 }
Esempio n. 4
0
 public int DistanceFrom(FlatRhombPoint other)
 {
     throw new NotImplementedException();
 }
Esempio n. 5
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(FlatRhombPoint edgePoint)
        {
            var faces = (edgePoint as IEdge <PointyTriPoint>).GetEdgeFaces();

            return(faces.Any(Contains));
        }