Class HexBound
Bounding boxes for cube coordinate hexes.
This can represent rhombuses and hex shapes drawn on the hex grid.
Assembly: Sylves.dll
Syntax
public class HexBound : IBound, IEnumerable<Cell>, IEnumerable
Constructors
HexBound(Vector3Int, Vector3Int)
Declaration
public HexBound(Vector3Int min, Vector3Int mex)
Parameters
Properties
Max
Inclusive upper bound for each coordinate
Declaration
public Vector3Int Max { get; set; }
Property Value
Mex
Exclusive upper bound for each coordinate
Declaration
public Vector3Int Mex { get; set; }
Property Value
Min
Inclusive lower bound for each coordinate
Declaration
public Vector3Int Min { get; set; }
Property Value
Methods
Contains(Cell)
Declaration
public bool Contains(Cell v)
Parameters
| Type |
Name |
Description |
| Cell |
v |
|
Returns
GetEnumerator()
Declaration
public IEnumerator<Cell> GetEnumerator()
Returns
Hexagon(int, Cell)
Returns a rough hexagonal shape of cells with a given distance of center, inclusive.
I.e. a radius 0 hexagon contains 1 cell, a radius 1 hexagon contains 7 cells.
Declaration
public static HexBound Hexagon(int radius, Cell center = default)
Parameters
| Type |
Name |
Description |
| int |
radius |
|
| Cell |
center |
|
Returns
Intersect(HexBound)
Declaration
public HexBound Intersect(HexBound other)
Parameters
Returns
Rhombus(int, int, int, int)
Returns a bound of a rhombus that bounds the X and Y axes.
Declaration
public static HexBound Rhombus(int minX, int minY, int maxX, int maxY)
Parameters
Returns
Union(HexBound)
Declaration
public HexBound Union(HexBound other)
Parameters
Returns
Implements