Class HexBound
Bounding boxes for cube coordinate hexes.
This can represent rhombuses and hex shapes drawn on the hex grid.
Inheritance
System.Object
HexBound
Implements
System.Collections.Generic.IEnumerable<
Cell>
System.Collections.IEnumerable
Assembly: Sylves.dll
Syntax
public class HexBound : Object, IBound
Constructors
HexBound(Vector3Int, Vector3Int)
Declaration
public HexBound(Vector3Int min, Vector3Int max)
Parameters
Fields
max
Exclusive upper bound for each coordinate
Declaration
Field Value
min
Inclusive lower bound for each coordinate
Declaration
Field Value
Methods
Contains(Cell)
Declaration
public bool Contains(Cell v)
Parameters
Type |
Name |
Description |
Cell |
v |
|
Returns
Type |
Description |
System.Boolean |
|
GetEnumerator()
Declaration
public IEnumerator<Cell> GetEnumerator()
Returns
Type |
Description |
System.Collections.Generic.IEnumerator<Cell> |
|
Hexagon(Int32, 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 = null)
Parameters
Type |
Name |
Description |
System.Int32 |
radius |
|
Cell |
center |
|
Returns
Intersect(HexBound)
Declaration
public HexBound Intersect(HexBound other)
Parameters
Returns
Rhombus(Int32, Int32, Int32, Int32)
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
Type |
Name |
Description |
System.Int32 |
minX |
|
System.Int32 |
minY |
|
System.Int32 |
maxX |
|
System.Int32 |
maxY |
|
Returns
Union(HexBound)
Declaration
public HexBound Union(HexBound other)
Parameters
Returns
Implements
System.Collections.Generic.IEnumerable<>
System.Collections.IEnumerable