Function planetkit::movement::adjacent_pos_in_dir [] [src]

pub fn adjacent_pos_in_dir(pos: GridPoint3, dir: Dir) -> Result<GridPoint3, ()>

Get next cell in direction faced by dir, without considering movement between roots. Note that this may therefore return positions outside the boundaries of pos's current root.

Returns an error if dir does not point to a direction that would represent an immediately adjacent cell if in a hexagon. (Movement toward vertices is undefined.)