Struct Hex
Inherited Members
System.ValueType.Equals(System.Object)
System.ValueType.GetHashCode()
System.ValueType.ToString()
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.ReferenceEquals(System.Object, System.Object)
Assembly: ladybug.dll
Syntax
Constructors
|
Improve this Doc
View Source
Hex(Int32, Int32, Int32)
Declaration
public Hex(int q, int r, int s)
Parameters
Type |
Name |
Description |
System.Int32 |
q |
|
System.Int32 |
r |
|
System.Int32 |
s |
|
Fields
|
Improve this Doc
View Source
DEFAULT_OFFSET
Default grid offset method
Declaration
public const HexOffset DEFAULT_OFFSET = HexOffset.Odd
Field Value
|
Improve this Doc
View Source
DEFAULT_ORIENTATION
Default hexagon orientation
Declaration
public const HexOrientation DEFAULT_ORIENTATION = HexOrientation.Point
Field Value
|
Improve this Doc
View Source
Diagonals
Declaration
public static readonly Hex[] Diagonals
Field Value
|
Improve this Doc
View Source
Directions
Declaration
public static readonly Hex[] Directions
Field Value
Properties
|
Improve this Doc
View Source
Length
Length of the Hex coordinate
Declaration
public readonly int Length { get; }
Property Value
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
Q
Declaration
public readonly int Q { get; }
Property Value
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
R
Declaration
public readonly int R { get; }
Property Value
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
S
Declaration
public readonly int S { get; }
Property Value
Type |
Description |
System.Int32 |
|
Methods
|
Improve this Doc
View Source
Add(Hex)
Declaration
public Hex Add(Hex other)
Parameters
Type |
Name |
Description |
Hex |
other |
|
Returns
|
Improve this Doc
View Source
Distance(Hex)
Get the distance between Hex coordinates
Declaration
public int Distance(Hex hex)
Parameters
Type |
Name |
Description |
Hex |
hex |
|
Returns
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
FromOffset(Point, HexOffset, HexOrientation)
Convert an offset coordinate to a Hex coordinate value
Declaration
public static Hex FromOffset(Point pos, HexOffset offset = HexOffset.Odd, HexOrientation orientation = HexOrientation.Point)
Parameters
Returns
|
Improve this Doc
View Source
FromOffset(Vector2, HexOffset, HexOrientation)
Convert an offset coordinate to a Hex coordinate value
Declaration
public static Hex FromOffset(Vector2 pos, HexOffset offset = HexOffset.Odd, HexOrientation orientation = HexOrientation.Point)
Parameters
Returns
|
Improve this Doc
View Source
FromOffset(Int32, Int32, HexOffset, HexOrientation)
Convert an offset coordinate value to a Hex coordinate value
Declaration
public static Hex FromOffset(int x, int y, HexOffset offset = HexOffset.Odd, HexOrientation orientation = HexOrientation.Point)
Parameters
Returns
|
Improve this Doc
View Source
RotateLeft()
Rotate Hex coordinate values counter-clockwise
Declaration
Returns
|
Improve this Doc
View Source
RotateRight()
Rotate Hex coordinate values clockwise
Declaration
Returns
|
Improve this Doc
View Source
Scale(Int32)
Declaration
Parameters
Type |
Name |
Description |
System.Int32 |
k |
|
Returns
|
Improve this Doc
View Source
Subtract(Hex)
Subtract two Hex coordinates
Declaration
public Hex Subtract(Hex other)
Parameters
Type |
Name |
Description |
Hex |
other |
|
Returns
|
Improve this Doc
View Source
ToOffset(HexOrientation, HexOffset)
Convert Hex coordinate to offset coordinate
Declaration
public Vector2 ToOffset(HexOrientation orientation = HexOrientation.Point, HexOffset offset = HexOffset.Odd)
Parameters
Returns
Type |
Description |
Microsoft.Xna.Framework.Vector2 |
|
Operators
|
Improve this Doc
View Source
Addition(Hex, Hex)
Declaration
public static Hex operator +(Hex a, Hex b)
Parameters
Type |
Name |
Description |
Hex |
a |
|
Hex |
b |
|
Returns
|
Improve this Doc
View Source
Subtraction(Hex, Hex)
Declaration
public static Hex operator -(Hex a, Hex b)
Parameters
Type |
Name |
Description |
Hex |
a |
|
Hex |
b |
|
Returns