Show / Hide Table of Contents

Class HexBound

Bounding boxes for cube coordinate hexes. This can represent rhombuses and hex shapes drawn on the hex grid.

Inheritance
object
HexBound
Implements
IBound
IEnumerable<Cell>
IEnumerable
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Namespace: Sylves
Assembly: Sylves.dll
Syntax
public class HexBound : IBound, IEnumerable<Cell>, IEnumerable

Constructors

HexBound(Vector3Int, Vector3Int)

Declaration
public HexBound(Vector3Int min, Vector3Int mex)
Parameters
Type Name Description
Vector3Int min
Vector3Int mex

Properties

Max

Inclusive upper bound for each coordinate

Declaration
public Vector3Int Max { get; set; }
Property Value
Type Description
Vector3Int

Mex

Exclusive upper bound for each coordinate

Declaration
public Vector3Int Mex { get; set; }
Property Value
Type Description
Vector3Int

Min

Inclusive lower bound for each coordinate

Declaration
public Vector3Int Min { get; set; }
Property Value
Type Description
Vector3Int

Methods

Contains(Cell)

Declaration
public bool Contains(Cell v)
Parameters
Type Name Description
Cell v
Returns
Type Description
bool

GetEnumerator()

Declaration
public IEnumerator<Cell> GetEnumerator()
Returns
Type Description
IEnumerator<Cell>

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
Type Description
HexBound

Intersect(HexBound)

Declaration
public HexBound Intersect(HexBound other)
Parameters
Type Name Description
HexBound other
Returns
Type Description
HexBound

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
Type Name Description
int minX
int minY
int maxX
int maxY
Returns
Type Description
HexBound

Union(HexBound)

Declaration
public HexBound Union(HexBound other)
Parameters
Type Name Description
HexBound other
Returns
Type Description
HexBound

Implements

IBound
IEnumerable<T>
IEnumerable
In this article
Back to top Generated by DocFX