pub struct NavGrid { /* private fields */ }Implementations§
pub fn new(cols: usize, rows: usize, cells: Vec<bool>) -> Result<NavGrid, Error>
pub fn with_connections( cols: usize, rows: usize, connections: Vec<NavGridConnection>, ) -> Result<NavGrid, Error>
pub fn id(&self) -> ID<NavGrid>
pub fn cells(&self) -> &[bool]
pub fn cells_costs(&self) -> &[f32]
pub fn set_cell_cost( &mut self, col: usize, row: usize, cost: f32, ) -> Option<f32>
pub fn neighbors( &self, col: usize, row: usize, ) -> Option<impl Iterator<Item = (usize, usize)>>
pub fn find_path( &self, from: (usize, usize), to: (usize, usize), ) -> Option<Vec<(usize, usize)>>
pub fn find_path_custom<F>( &self, from: (usize, usize), to: (usize, usize), filter: F, ) -> Option<Vec<(usize, usize)>>
pub fn find_islands(&self) -> Vec<Vec<(usize, usize)>>
pub fn index(&self, col: usize, row: usize) -> Option<usize>
pub fn coord(&self, index: usize) -> Option<(usize, usize)>
Trait Implementations§
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<NavGrid, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<NavGrid, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Initialize for Twhere
T: Default,
impl<T> Initialize for Twhere
T: Default,
fn initialize(&mut self)
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§unsafe fn to_subset_unchecked(&self) -> SS
unsafe fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.