pub struct PathfindingContext<'a> {
level: &'a dyn LevelReader,
cache: Option<&'a mut PathTypeCache>,
mob_position: BlockPos,
}Fields§
§level: &'a dyn LevelReader§cache: Option<&'a mut PathTypeCache>§mob_position: BlockPosImplementations§
Source§impl<'a> PathfindingContext<'a>
impl<'a> PathfindingContext<'a>
pub const fn new(level: &'a dyn LevelReader, mob_position: BlockPos) -> Self
pub fn with_cache( level: &'a dyn LevelReader, mob_position: BlockPos, cache: &'a mut PathTypeCache, ) -> Self
pub fn get_path_type_from_state(&mut self, x: i32, y: i32, z: i32) -> PathType
pub fn get_block_state(&self, pos: BlockPos) -> BlockStateId
pub const fn level(&self) -> &dyn LevelReader
pub const fn mob_position(&self) -> BlockPos
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for PathfindingContext<'a>
impl<'a> !Send for PathfindingContext<'a>
impl<'a> !Sync for PathfindingContext<'a>
impl<'a> !UnwindSafe for PathfindingContext<'a>
impl<'a> Freeze for PathfindingContext<'a>
impl<'a> Unpin for PathfindingContext<'a>
impl<'a> UnsafeUnpin for PathfindingContext<'a>
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<>>