pub struct HPGCell {
pub bbox: AARectangle,
pub centroid: Point,
pub radius: fsize,
pub uni_prox: (fsize, HazardEntity),
pub static_uni_prox: (fsize, HazardEntity),
pub qz_prox: [fsize; 10],
}
Expand description
Represents a cell in the Hazard Proximity Grid
Fields§
§bbox: AARectangle
§centroid: Point
§radius: fsize
§uni_prox: (fsize, HazardEntity)
Proximity of closest hazard which is universally applicable (bin or item), zero if inside
static_uni_prox: (fsize, HazardEntity)
Proximity of universal static hazards, zero if inside
qz_prox: [fsize; 10]
proximity of closest quality zone for each quality, zero if inside
Implementations§
Source§impl HPGCell
impl HPGCell
pub fn new(bbox: AARectangle, static_hazards: &[Hazard]) -> Self
pub fn register_hazards<'a, I>(&mut self, to_register: I)
pub fn register_hazard(&mut self, to_register: &Hazard) -> HPGCellUpdate
pub fn register_hazard_pole( &mut self, to_register: &Hazard, pole: &Circle, ) -> HPGCellUpdate
pub fn deregister_hazards<'a, I, J>( &mut self, to_deregister: J, remaining: I, ) -> HPGCellUpdate
pub fn could_accommodate_item(&self, item: &Item) -> bool
pub fn hazard_proximity(&self, quality_level: Option<usize>) -> fsize
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HPGCell
impl RefUnwindSafe for HPGCell
impl Send for HPGCell
impl Sync for HPGCell
impl Unpin for HPGCell
impl UnwindSafe for HPGCell
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