Crate hexgridspiral

Crate hexgridspiral 

Source
Expand description

Hexagonal Cube-Coordinate System with Spiralling Integer Tile Identifiers

Read the README for

  • an Abstract
  • Construction Examples
  • A list of Features

Structs§

CCTile
CubeCoordinates Tile For reference: https://www.redblobgames.com/grids/hexagons/
HGSTile
Hexgrid Spiral Tile
MovementRange
https://www.redblobgames.com/grids/hexagons/#range-coordinate
Ring
A Ring is hexagonal and consists of tiles. All Ring-Corner Tiles have the same number of steps to the origin. The other tiles in the Ring are on straight edges between corners. The RingIndex counts from 1 and thus is always equal to the Ring::edge_size.
RingEdge
An identifier for each side of the ring’s edge. Numbered counterclockwise from the top-right edge.
RingIndex
Which Ring around the origin we’re at, counting from 1. Implementation Detail: The RingIndex wraps an integer that equals the number of tiles in one edge of the Ring (including both corners).
TileIndex

Enums§

RingCornerIndex
An identifier for each corner of the ring’s edge. Numbered counterclockwise, from the right corner. The n-th corner is the start of the n-th edge.

Functions§

ring_index_for_tile_index
Compute the ring-index n for the ring with the maximum element h. You can also pass any other tile-index. This is the inversion of ring_max.