pub struct AutoNavigator {
pub goal_x: f32,
pub goal_y: f32,
/* private fields */
}Fields§
§goal_x: f32§goal_y: f32Implementations§
pub fn plan(state: &GameState, goal_x: f32, goal_y: f32) -> Option<Self>
pub fn active(&self) -> bool
Sourcepub fn replan(&mut self, state: &GameState) -> bool
pub fn replan(&mut self, state: &GameState) -> bool
Recompute path from current position (e.g. after getting stuck on an obstacle).
Returns false only after several failed attempts — keeps trying around buildings.
Sourcepub fn note_progress(&mut self, px: f32, py: f32) -> bool
pub fn note_progress(&mut self, px: f32, py: f32) -> bool
Returns true when movement has not progressed and a replan is advised.
Trait Implementations§
Source§fn clone(&self) -> AutoNavigator
fn clone(&self) -> AutoNavigator
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto 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