Crate neighborgrid

Crate neighborgrid 

Source

Structs§

AllAroundNeighbor
Coordinates
A stronger-typed way of expressing coordinates than just a tuple of (isize, isize)
Grid
A collection that represents a 2-D grid with equal amount of cells in each row and equal number of cells in each column. Supports different origin (location of 0,0) configurations, and includes methods to get neighbors of cells, iterators, and more. Behind the scenes, the data is stored in a 1-D Vec to improve performance, but interaction with grid is done through normal (x,y) grid location methods.
GridOptions
Custom configuration of the grid. For most grids out there, with x and y values always positive, an origin: Origin::UpperLeft and inverted_y: true is the best fit, and therefore is the default setting. wrap_x and wrap_y properties, if true wrap around the grid when calling get_up or xy_neighbor or any other method that returns neighbors of a called cell. These parameters do not affect iterators.
XyNeighbor
Represents (0,1), (0,1), (-1,0), (1,0) relative values to the specific point

Enums§

GridError
Origin
Determines where (0,0) is on the grid. Care should be taken with Center, especially with even number of rows or columns, for example:

Traits§

Index
IntoGrid