Enum HexEdgeDirection
Canonical edge direction for a hexagonal grid cell. Only three of the six edges are stored per hex to avoid duplication.
Namespace: Scylla.Core.Structures
Assembly: ScyllaCore.dll
Syntax
public enum HexEdgeDirection
Remarks
Each hex has six edges but each edge is shared by exactly two adjacent hexes. To give every edge a unique canonical representation, only three directions are stored per cell: E, NE, and NW. The remaining three edges are the canonical edges of neighboring cells:
- W edge of (q, r) = E edge of (q-1, r)
- SW edge of (q, r) = NE edge of (q-1, r+1)
- SE edge of (q, r) = NW edge of (q, r+1)
Use HexEdgeCoord to uniquely identify an edge by its anchor hex and a HexEdgeDirection. Use HexEdgeMap<TData> to store per-edge data.
Fields
| Name | Description |
|---|---|
| E | East edge of the hex. Separates the anchor hex from its eastern neighbor at (q+1, r). |
| NE | Northeast edge of the hex. Separates the anchor hex from its northeastern neighbor at (q+1, r-1). |
| NW | Northwest edge of the hex. Separates the anchor hex from its northern neighbor at (q, r-1). |