Module planetkit::movement [] [src]

Enums

TurnDir

Functions

adjacent_pos_in_dir

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.

is_pentagon
move_forward

Returns an error if pos and dir do not point at an edge of the current cell; it's illegal to move toward a cell vertex.

step_backward_and_face_neighbor

Move backward by one cell and ensure dir now points to a legal direction for continued movement.

step_forward_and_face_neighbor

Move forward by one cell and ensure dir now points to a legal direction for continued movement.

turn_around_and_face_neighbor
turn_by_one_hex_edge

Returns an error if pos and dir do not point at an edge of the current cell; this is intended for rotating to valid directions for forward movement, which isnt possible if the starting direction is illegal.

turn_left_by_one_hex_edge

See turn_by_one_hex_edge.

turn_right_by_one_hex_edge

See turn_by_one_hex_edge.