コード例 #1
0
        public static AbstractBounds <GridPoint3> Erode(AbstractBounds <GridPoint3> bounds)
        {
            var point = bounds.Point + GridPoint3.One;
            var size  = bounds.Size - 2 * GridPoint3.One;

            return(new GridBounds(point, size));
        }
コード例 #2
0
ファイル: GridRect.cs プロジェクト: yfdtc12345/Football
        public static AbstractBounds <GridPoint2> Dilate(AbstractBounds <GridPoint2> rect)
        {
            var point = rect.Point - GridPoint2.One;
            var size  = rect.Size + 2 * GridPoint2.One;

            return(new GridRect(point, size));
        }
コード例 #3
0
        public static AbstractBounds <GridPoint3> Dilate(AbstractBounds <GridPoint3> bounds)
        {
            var point = bounds.Point - GridPoint3.One;
            var size  = bounds.Size + 2 * GridPoint3.One;

            return(new GridBounds(point, size));
        }
コード例 #4
0
ファイル: GridRect.cs プロジェクト: yfdtc12345/Football
        public static AbstractBounds <GridPoint2> Erode(AbstractBounds <GridPoint2> rect)
        {
            var point = rect.Point + GridPoint2.One;
            var size  = rect.Size - 2 * GridPoint2.One;

            return(new GridRect(point, size));
        }
コード例 #5
0
ファイル: GridInterval.cs プロジェクト: Radeg/dots_all-modes
        public static AbstractBounds<int> Erode(AbstractBounds<int> rect)
        {
            var point = rect.Point + 1;
            var size = rect.Size - 2 * 1;

            return new GridInterval(point, size);
        }
コード例 #6
0
ファイル: GridInterval.cs プロジェクト: Radeg/dots_all-modes
        public static AbstractBounds<int> Dilate(AbstractBounds<int> rect)
        {
            var point = rect.Point - 1;
            var size = rect.Size + 2 * 1;

            return new GridInterval(point, size);
        }
コード例 #7
0
ファイル: GridRect.cs プロジェクト: yfdtc12345/Football
        public static GridRect UnionBoundingBox(AbstractBounds <GridPoint2> rect1, AbstractBounds <GridPoint2> rect2)
        {
            var bottomLeft = GridPoint2.Min(rect1.Point, rect2.Point);
            var topRight   = GridPoint2.Max(rect1.Extreme, rect2.Extreme);
            var dimensions = topRight - bottomLeft;

            return(new GridRect(bottomLeft, dimensions));
        }
コード例 #8
0
ファイル: GridInterval.cs プロジェクト: Radeg/dots_all-modes
        public static AbstractBounds<int> UnionBoundingBox(AbstractBounds<int> rect1, AbstractBounds<int> rect2)
        {
            var bottomLeft = Mathf.Min(rect1.Point, rect2.Point);
            var topRight = Mathf.Max(rect1.Extreme, rect2.Extreme);
            var dimensions = topRight - bottomLeft;

            return new GridInterval(bottomLeft, dimensions);
        }
コード例 #9
0
        public static GridBounds Intersection(AbstractBounds <GridPoint3> bounds1, AbstractBounds <GridPoint3> bounds2)
        {
            var bottomLeft = GridPoint3.Max(bounds1.Point, bounds2.Point);
            var topRight   = GridPoint3.Min(bounds1.Extreme, bounds2.Extreme);

            var dimensions = topRight - bottomLeft;

            return(new GridBounds(bottomLeft, dimensions));
        }
コード例 #10
0
 public static AbstractBounds <GridPoint3> Translate(AbstractBounds <GridPoint3> bounds, GridPoint3 offset)
 {
     return(new GridBounds(bounds.Point + offset, bounds.Size));
 }
コード例 #11
0
ファイル: GridBounds.cs プロジェクト: Radeg/dots_all-modes
 public static AbstractBounds <GridPoint3> Translate(AbstractBounds <GridPoint3> rect, GridPoint3 offset)
 {
     return(new GridBounds(rect.Point + offset, rect.Size));
 }
コード例 #12
0
ファイル: GridInterval.cs プロジェクト: Radeg/dots_all-modes
 public static AbstractBounds<int> Translate(AbstractBounds<int> rect, int offset)
 {
     return new GridInterval(rect.Point + offset, rect.Size);
 }
コード例 #13
0
ファイル: ExplicitShape.cs プロジェクト: Radeg/dots_all-modes
 public ExplicitShape1(IImplicitShape <int> implicitShape, AbstractBounds <int> storageBounds)
 {
     this.implicitShape = implicitShape;
     this.storageBounds = storageBounds;
 }
コード例 #14
0
ファイル: ExplicitShape.cs プロジェクト: Radeg/dots_all-modes
 public static IExplicitShape <GridPoint3> ToExplicit(this IImplicitShape <GridPoint3> shape, AbstractBounds <GridPoint3> bounds)
 {
     return(new ExplicitShape3(shape, bounds));
 }
コード例 #15
0
ファイル: ExplicitShape.cs プロジェクト: Radeg/dots_all-modes
 public static IExplicitShape <int> ToExplicit(this IImplicitShape <int> shape, AbstractBounds <int> bounds)
 {
     return(new ExplicitShape1(shape, bounds));
 }
コード例 #16
0
ファイル: ExplicitShape.cs プロジェクト: Radeg/dots_all-modes
 public ExplicitShape3(IImplicitShape <GridPoint3> implicitShape, AbstractBounds <GridPoint3> storageBounds)
 {
     this.implicitShape = implicitShape;
     this.storageBounds = storageBounds;
 }