pub struct FollowMobGoal {
following_mob: Option<SharedEntity>,
follow_predicate: Box<dyn Fn(&dyn PathfinderMob, &dyn Mob) -> bool + Send + Sync>,
speed_modifier: f64,
time_to_recalc_path: i32,
stop_distance: f32,
old_water_cost: f32,
area_size: f32,
}Fields§
§following_mob: Option<SharedEntity>§follow_predicate: Box<dyn Fn(&dyn PathfinderMob, &dyn Mob) -> bool + Send + Sync>§speed_modifier: f64§time_to_recalc_path: i32§stop_distance: f32§old_water_cost: f32§area_size: f32Implementations§
Source§impl FollowMobGoal
impl FollowMobGoal
pub(crate) fn new( speed_modifier: f64, stop_distance: f32, area_size: f32, follow_predicate: impl Fn(&dyn PathfinderMob, &dyn Mob) -> bool + Send + Sync + 'static, ) -> Self
fn stop_distance_sqr(&self) -> f64
fn should_back_away( &self, mob: &dyn PathfinderMob, following_mob: &SharedEntity, ) -> bool
Trait Implementations§
Source§impl Goal for FollowMobGoal
impl Goal for FollowMobGoal
fn controls(&self) -> GoalControls
fn can_use(&mut self, mob: &dyn PathfinderMob) -> bool
fn can_continue_to_use(&mut self, mob: &dyn PathfinderMob) -> bool
fn start(&mut self, mob: &dyn PathfinderMob)
fn stop(&mut self, mob: &dyn PathfinderMob)
fn tick(&mut self, mob: &dyn PathfinderMob)
fn is_interruptable(&self) -> bool
fn is_panic_goal(&self) -> bool
fn requires_update_every_tick(&self) -> bool
Auto Trait Implementations§
impl !RefUnwindSafe for FollowMobGoal
impl !UnwindSafe for FollowMobGoal
impl Freeze for FollowMobGoal
impl Send for FollowMobGoal
impl Sync for FollowMobGoal
impl Unpin for FollowMobGoal
impl UnsafeUnpin for FollowMobGoal
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreWraps this value in an
Arc<SyncMutex<>>