Skip to content

Extension points

tilttek/grid

The package is at 0.x: its extension points are stable only from its 1.0 release. Until then, a minor version may change them, and its CHANGELOG says how.

PointWhat an application givesWhere
What blocks the sightA closure that says whether a cell or a hexagon blocks, read from its own mapMeasuring
The diagonal rule and the roundingThe rule of its game, and the \RoundingMode of its distancesMeasuring
The placement of a gridThe origin and sizes it stores beside a map, or the two cells a user clickedGrids on images

Every type is an immutable value; the library calls nothing but the closures it is given and keeps no state between two calls.