Click or drag to resize

FlatHexOpTCellShape Method (Int32, Int32, FuncFlatHexPoint, Boolean, FlatHexPoint)

Use this function to create shapes to ensure they fit into memory. The test function can test shapes anywhere in space.If you specify the bottom corner (in terms of the storage rectangle), the shape is automatically translated in memory to fit, assuming memory width and height is big enough. Strategy for implementing new shapes: - First, determine the test function. - Next, draw a storage rectangle that contains the shape. - Determine the storgae rectangle width and height. - Finally, determine the grid-space coordinate of the left bottom corner of the storage rectangle. Then define your function as follows:
public FlatHexShapeInfo<TCell> MyShape()
{
    Shape(stargeRectangleWidth, storageRectangleHeight, isInsideMyShape, storageRectangleBottomleft);
}

Namespace:  Gamelogic.Grids
Assembly:  Assembly-CSharp (in Assembly-CSharp.dll) Version: 0.0.0.0
Syntax
C#
public FlatHexShapeInfo<TCell> Shape(
	int width,
	int height,
	Func<FlatHexPoint, bool> isInside,
	FlatHexPoint bottomLeftCorner
)

Parameters

width
Type: SystemInt32
The widh of the storage rectangle
height
Type: SystemInt32
The height of the storage rectangle
isInside
Type: SystemFuncFlatHexPoint, Boolean
A function that returns true if a passed point lies inside the shape being defined
bottomLeftCorner
Type: Gamelogic.GridsFlatHexPoint
The grid-space coordinate of the bottom left corner of the storage rect.

Return Value

Type: FlatHexShapeInfoTCell
See Also