Closed neapel closed 11 years ago
That's a good idea. I'll have to think about how the centre should be defined for grids that don't have a boundary (like the torus), or to grids that would have multiple tiles tied for "centre", like a RectSquareGrid
with sides that are even (e.g., 4x6). One option might be to modify the numbering scheme so that the centre of the grid (or at least one of the centres) is at (0,0).
Version 3.0 adds a centre
function, a boundary
function, and more. Note that this version changed the order of parameters for many functions. This makes it easier for the user to write mapping and folding operations.
It would be helpful to have a method in the interface that returns the center of a grid, such that
A grid implementation would of course know in O(1) where its center is, but code that is supposed to work with
HexHexGrid
as well asRectSquareGrid
can't just use(0,0)
, for example.