Enum HexCornerPosition
Canonical corner position for a hexagonal grid cell. Only two of the six corners are stored per hex to avoid duplication.
Namespace: Scylla.Core.Structures
Assembly: ScyllaCore.dll
Syntax
public enum HexCornerPosition
Remarks
Each hex has six corner vertices but each vertex is shared by exactly three hexes. To give every corner a unique canonical representation, only two positions are stored per cell: N (north) and S (south). The other four corners of a hex are the N or S corners of its neighboring cells.
The visual position depends on grid orientation:
- Pointy-top (PointyTop): N = top vertex, S = bottom vertex.
- Flat-top (FlatTop): N = rightmost vertex, S = leftmost vertex.
The underlying canonical math is the same in both cases; only the visual interpretation of the N/S labels changes.
Use HexCornerCoord to uniquely identify a corner by its anchor hex and a HexCornerPosition. Use HexCornerMap<TData> to store per-corner data.
Fields
| Name | Description |
|---|---|
| N | North corner of the hex. In pointy-top grids this is the top vertex; in flat-top grids this is the rightmost vertex. For cell (q, r), the N corner is shared with cells (q+1, r-1) and (q, r-1). |
| S | South corner of the hex. In pointy-top grids this is the bottom vertex; in flat-top grids this is the leftmost vertex. For cell (q, r), the S corner is shared with cells (q-1, r+1) and (q, r+1). |