Table of Contents

Class AbstractShapeInfo<TShapeInfo, TGrid, TPoint, TVectorPoint, TShapeOp>

Namespace
Gamelogic.Grids
Assembly
Assembly-CSharp.dll

The base class of shape info classes

[Version(1, 0, 0)]
public abstract class AbstractShapeInfo<TShapeInfo, TGrid, TPoint, TVectorPoint, TShapeOp> : IShapeInfo<TShapeInfo, TGrid, TPoint, TVectorPoint, TShapeOp> where TShapeInfo : IShapeInfo<TShapeInfo, TGrid, TPoint, TVectorPoint, TShapeOp> where TGrid : IGridSpace<TPoint> where TPoint : ISplicedVectorPoint<TPoint, TVectorPoint>, IGridPoint<TPoint> where TVectorPoint : IVectorPoint<TVectorPoint>

Type Parameters

TShapeInfo
TGrid
TPoint
TVectorPoint
TShapeOp
Inheritance
AbstractShapeInfo<TShapeInfo, TGrid, TPoint, TVectorPoint, TShapeOp>
Implements
IShapeInfo<TShapeInfo, TGrid, TPoint, TVectorPoint, TShapeOp>
Derived
Inherited Members
Extension Methods

Constructors

AbstractShapeInfo(ShapeStorageInfo<TPoint>)

protected AbstractShapeInfo(ShapeStorageInfo<TPoint> info)

Parameters

info ShapeStorageInfo<TPoint>

Fields

shapeStorageStorageInfo

protected ShapeStorageInfo<TPoint> shapeStorageStorageInfo

Field Value

ShapeStorageInfo<TPoint>

Properties

ShapeStorageStorageInfo

public ShapeStorageInfo<TPoint> ShapeStorageStorageInfo { get; }

Property Value

ShapeStorageInfo<TPoint>

Methods

ArrayPointFromGridPoint(TVectorPoint)

protected abstract ArrayPoint ArrayPointFromGridPoint(TVectorPoint point)

Parameters

point TVectorPoint

Returns

ArrayPoint

Difference()

Provides a shape operator that will form the difference of the shape describe by this instance and the shape info generated by one of the shape functions of the shape operator returned by this function.

public TShapeOp Difference()

Returns

TShapeOp

EndShape()

This functions is called to end shape construction and returned a grid described by this shape info.

public TGrid EndShape()

Returns

TGrid

Filter(Func<TPoint, bool>)

public TShapeInfo Filter(Func<TPoint, bool> filter)

Parameters

filter Func<TPoint, bool>

Returns

TShapeInfo

GridPointFromArrayPoint(ArrayPoint)

protected abstract TVectorPoint GridPointFromArrayPoint(ArrayPoint point)

Parameters

point ArrayPoint

Returns

TVectorPoint

If(bool)

public TShapeOp If(bool condition)

Parameters

condition bool

Returns

TShapeOp

IfTranslate(bool, int, int)

public TShapeInfo IfTranslate(bool condition, int x, int y)

Parameters

condition bool
x int
y int

Returns

TShapeInfo

Intersection()

Provides a shape operator that will form the intersection of the shape describe by this instance and the shape info generated by one of the shape functions of the shape operator returned by this function.

public TShapeOp Intersection()

Returns

TShapeOp

MakeOp(ShapeStorageInfo<TPoint>, Func<ShapeStorageInfo<TPoint>, ShapeStorageInfo<TPoint>, ShapeStorageInfo<TPoint>>)

protected abstract TShapeOp MakeOp(ShapeStorageInfo<TPoint> shapeInfo, Func<ShapeStorageInfo<TPoint>, ShapeStorageInfo<TPoint>, ShapeStorageInfo<TPoint>> combineInfo)

Parameters

shapeInfo ShapeStorageInfo<TPoint>
combineInfo Func<ShapeStorageInfo<TPoint>, ShapeStorageInfo<TPoint>, ShapeStorageInfo<TPoint>>

Returns

TShapeOp

MakePoint(int, int)

protected abstract TVectorPoint MakePoint(int x, int y)

Parameters

x int
y int

Returns

TVectorPoint

MakeShape(int, int, Func<TPoint, bool>, TVectorPoint)

protected abstract TGrid MakeShape(int x, int y, Func<TPoint, bool> isInside, TVectorPoint offset)

Parameters

x int
y int
isInside Func<TPoint, bool>
offset TVectorPoint

Returns

TGrid

MakeShapeInfo(ShapeStorageInfo<TPoint>)

protected abstract TShapeInfo MakeShapeInfo(ShapeStorageInfo<TPoint> shapeStorageInfo)

Parameters

shapeStorageInfo ShapeStorageInfo<TPoint>

Returns

TShapeInfo

SymmetricDifference()

Calculates the symmetric difference of all storged shape info.

[Version(1, 1, 0)]
public TShapeOp SymmetricDifference()

Returns

TShapeOp

The resulting shape is the union of the first and immediately following shape, minus the intersection of the two shapes.

Translate(int, int)

public TShapeInfo Translate(int x, int y)

Parameters

x int
y int

Returns

TShapeInfo

Translate(TVectorPoint)

Assumption: ArrayFromGridPoint(p1 + offset) == ArrayFromGridPoint(p1) + ArrayFromGridPoint(offset)

public TShapeInfo Translate(TVectorPoint offset)

Parameters

offset TVectorPoint

Returns

TShapeInfo

Union()

Provides a shape operator that will form the union of the shape describe by this instance and the shape info generated by one of the shape functions of the shape operator returned by this function.

public TShapeOp Union()

Returns

TShapeOp