Click or drag to resize

FlatHexOpTCell Class

Documentation in Op.cs
Class for making FlatHexGrids in different shapes. Copyright Gamelogic. Author Herman Tulleken Since version 1.0 See also AbstractOp
Inheritance Hierarchy
SystemObject
  Gamelogic.GridsAbstractOpShapeStorageInfoFlatHexPoint
    Gamelogic.GridsFlatHexOpTCell

Namespace:  Gamelogic.Grids
Assembly:  Assembly-CSharp (in Assembly-CSharp.dll) Version: 0.0.0.0
Syntax
C#
public class FlatHexOp<TCell> : AbstractOp<ShapeStorageInfo<FlatHexPoint>>

Type Parameters

TCell

The FlatHexOpTCell type exposes the following members.

Constructors
Methods
  NameDescription
Public methodBeginGroup
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);
}
Since version 1.1
Public methodDefault
Creates the grid in a shape that spans the entire storage rectangle of the given width and height.
Public methodDiamond
Bottom corner is the origin.
Public methodEquals (Inherited from Object.)
Public methodFatRectangle
Bottom left corner is the origin.
Protected methodFinalize (Inherited from Object.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Public methodHexagon(Int32)
Center is the origin.
Public methodHexagon(FlatHexPoint, Int32)
Bottom corner is the origin.
Public methodLeftTriangle
Bottom corner is the origin.
Public methodMakeShapeStorageInfo(TShapeInfo) (Inherited from AbstractOpTShapeInfo.)
Public methodMakeShapeStorageInfoTPoint(IntRect, FuncTPoint, Boolean) (Inherited from AbstractOpTShapeInfo.)
Public methodMakeShapeStorageInfoTPoint(Int32, Int32, FuncTPoint, Boolean) (Inherited from AbstractOpTShapeInfo.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodParallelogram
Bottom corner is the origin.
Public methodRectangle
Bottom left corner is the origin.
Public methodRightTriangle
Bottom corner is the origin.
Public methodShape(Int32, Int32, FuncFlatHexPoint, Boolean)
The same as Shape with all parameters, but with bottomLeft Point set to FlatHexPoint.Zero.
Public methodShape(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);
}
Public methodSingle
Makes a grid with a single cell that corresponds to the origin.
Public methodThinRectangle
Bottom left corner is the origin.
Public methodToString (Inherited from Object.)
Top
Fields
Extension Methods
  NameDescription
Public Extension MethodThrowIfNull
Throws a NullReferenceException if the object is null.
(Defined by ObjectExtensions.)
Top
See Also