 | PointyRhombOpTCellShape Method (Int32, Int32, FuncPointyRhombPoint, Boolean, PointyHexPoint) |
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 PointyRhombShapeInfo<TCell> MyShape()
{
Shape(stargeRectangleWidth, storageRectangleHeight, isInsideMyShape, storageRectangleBottomleft);
}
Namespace:
Gamelogic.Grids
Assembly:
Assembly-CSharp (in Assembly-CSharp.dll) Version: 0.0.0.0
Syntaxpublic PointyRhombShapeInfo<TCell> Shape(
int width,
int height,
Func<PointyRhombPoint, bool> isInside,
PointyHexPoint bottomLeftCorner
)
Parameters
- width
- Type: SystemInt32
The widh of the storage rectangle - height
- Type: SystemInt32
The height of the storage rectangle - isInside
- Type: SystemFuncPointyRhombPoint, Boolean
A function that returns true if a passed point lies inside the shape being defined - bottomLeftCorner
- Type: Gamelogic.GridsPointyHexPoint
The grid-space coordinate of the bottom left corner of the storage rect.
Return Value
Type:
PointyRhombShapeInfoTCell
See Also