pub struct HazardProximityGrid {
pub bbox: AARectangle,
pub grid: Grid<HPGCell>,
pub cell_radius: fsize,
/* private fields */
}
Expand description
Grid of cells which store information about hazards in their vicinity. The grid is a part of the CDE and is thus automatically updated when hazards are registered or deregistered.
Fields§
§bbox: AARectangle
§grid: Grid<HPGCell>
§cell_radius: fsize
Implementations§
Source§impl HazardProximityGrid
impl HazardProximityGrid
pub fn new(bbox: AARectangle, static_hazards: &[Hazard], n_cells: usize) -> Self
pub fn restore(&mut self, grid: Grid<HPGCell>)
pub fn register_hazard(&mut self, to_register: &Hazard)
pub fn deregister_hazard<'a, I>( &mut self, to_deregister: HazardEntity, remaining: I, process_now: bool, )
pub fn flush_deregisters<'a, I>(&mut self, remaining: I)
pub fn is_dirty(&self) -> bool
Trait Implementations§
Source§impl Clone for HazardProximityGrid
impl Clone for HazardProximityGrid
Source§fn clone(&self) -> HazardProximityGrid
fn clone(&self) -> HazardProximityGrid
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for HazardProximityGrid
impl RefUnwindSafe for HazardProximityGrid
impl Send for HazardProximityGrid
impl Sync for HazardProximityGrid
impl Unpin for HazardProximityGrid
impl UnwindSafe for HazardProximityGrid
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> 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 more