Example #1
0
		private static bool IsInsideParallelogramXZ(PointyTriPoint point, int width, int height)
		{
			return
				point.X >= 0 &&
				point.X < width &&
				point.Z >= 0 &&
				point.Z < height;
		}
Example #2
0
        public static bool DefaultContains(PointyTriPoint point, int width, int height)
        {
            ArrayPoint storagePoint = ArrayPointFromGridPoint(point.BasePoint);

            return
                (storagePoint.X >= 0 &&
                 storagePoint.X < width &&
                 storagePoint.Y >= 0 &&
                 storagePoint.Y < height);
        }
Example #3
0
		private static bool IsInsideLeftTriangle(PointyTriPoint point, int side)
		{
			if (point.Y >= side) return false;
			if (point.X >= 0) return false;
			if (point.Z > 0) return false;

			//if ()

			return true;
		}
Example #4
0
 public InspectableSplicedVectorPoint(PointyTriPoint point)
 {
     x     = point.X;
     y     = point.Y;
     index = point.I;
 }
Example #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 PointyTriGrid(int width, int height, Func <PointyTriPoint, bool> isInside, PointyTriPoint offset) :
     this(width, height, isInside, x => x.MoveBy(offset), x => x.MoveBackBy(offset), PointyTriPoint.MainDirections)
 {
 }
Example #6
0
		private static bool IsInsideRightTriangle(PointyTriPoint point, int side)
		{
			int y = 2 * (point.X + point.Y) + point.I;
			return point.Y >= 0 && y < 2 * side - 1 && point.X >= 0;
		}
Example #7
0
 public int DistanceFrom(PointyTriPoint other)
 {
     throw new NotImplementedException();
 }
Example #8
0
        /**
         *      A test function that returns true if the point for which the given
         *      vertexPoint is a vertex, is inside this grid.
         */
        private bool IsInsideVertexGrid(PointyTriPoint vertexPoint)
        {
            var faces = (vertexPoint as IVertex <FlatHexPoint>).GetVertexFaces();

            return(faces.Any(Contains));
        }