get_next_step_direction_in_vec_pos

Function get_next_step_direction_in_vec_pos 

Source
pub fn get_next_step_direction_in_vec_pos(
    current_pos: &Position,
    path: &[Position],
) -> Option<Direction>
Expand description

Utility function for converting a position and a path into a direction for the next movement on the path.

If the position is not on the path, it will return a direction that moves the creep towards the first position of the path.

Returns None if the current position is the final position in the path, or if the path is empty.