FlatHexOpTCell Class |
Namespace: Gamelogic.Grids
public class FlatHexOp<TCell> : AbstractOp<ShapeStorageInfo<FlatHexPoint>>
The FlatHexOpTCell type exposes the following members.
| Name | Description | |
|---|---|---|
| FlatHexOpTCell | ||
| FlatHexOpTCell(ShapeStorageInfoFlatHexPoint, FuncShapeStorageInfoFlatHexPoint, ShapeStorageInfoFlatHexPoint, ShapeStorageInfoFlatHexPoint) |
| Name | Description | |
|---|---|---|
| BeginGroup |
Starts a compound shape operation.
Any shape that is defined in terms of other shape operations must use this method, and use Endgroup() to end the definition.
public static FlatHexShapeInfo<TCell> MyCustomShape(this FlatHexOp<TCell> op) { return BeginGroup() .Shape1() .Union() .Shape2() .EndGroup(op); } | |
| Default |
Creates the grid in a shape that spans
the entire storage rectangle of the given width and height.
| |
| Diamond |
Bottom corner is the origin.
| |
| Equals | (Inherited from Object.) | |
| FatRectangle |
Bottom left corner is the origin.
| |
| Finalize | (Inherited from Object.) | |
| GetHashCode | (Inherited from Object.) | |
| GetType | (Inherited from Object.) | |
| Hexagon(Int32) |
Center is the origin.
| |
| Hexagon(FlatHexPoint, Int32) |
Bottom corner is the origin.
| |
| LeftTriangle |
Bottom corner is the origin.
| |
| MakeShapeStorageInfo(TShapeInfo) | (Inherited from AbstractOpTShapeInfo.) | |
| MakeShapeStorageInfoTPoint(IntRect, FuncTPoint, Boolean) | (Inherited from AbstractOpTShapeInfo.) | |
| MakeShapeStorageInfoTPoint(Int32, Int32, FuncTPoint, Boolean) | (Inherited from AbstractOpTShapeInfo.) | |
| MemberwiseClone | (Inherited from Object.) | |
| Parallelogram |
Bottom corner is the origin.
| |
| Rectangle |
Bottom left corner is the origin.
| |
| RightTriangle |
Bottom corner is the origin.
| |
| Shape(Int32, Int32, FuncFlatHexPoint, Boolean) |
The same as Shape with all parameters, but with bottomLeft Point set to FlatHexPoint.Zero.
| |
| Shape(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);
} | |
| Single |
Makes a grid with a single cell that corresponds to the origin.
| |
| ThinRectangle |
Bottom left corner is the origin.
| |
| ToString | (Inherited from Object.) |
| Name | Description | |
|---|---|---|
| combineShapeInfo | (Inherited from AbstractOpTShapeInfo.) | |
| leftShapeInfo | (Inherited from AbstractOpTShapeInfo.) |
| Name | Description | |
|---|---|---|
| ThrowIfNull |
Throws a NullReferenceException if the object is null.
(Defined by ObjectExtensions.) |