Skip to main content
Verticopolis engine

PeopleWindow

Struct PeopleWindow 

Source
pub struct PeopleWindow {
    pub floor_lo: f64,
    pub floor_hi: f64,
    pub x_lo: f64,
    pub x_hi: f64,
}
Expand description

The floors and tiles a view shows: a person is in it when their floor position (fy) lies within floor_lo..=floor_hi and their tile (x) within x_lo..=x_hi, after the pads PeopleWindow::padded adds.

Fields§

§floor_lo: f64

The lowest floor shown.

§floor_hi: f64

The highest floor shown.

§x_lo: f64

The leftmost tile shown.

§x_hi: f64

The rightmost tile shown.

Implementations§

Source§

impl PeopleWindow

Source

pub fn new( floor_lo: f64, floor_hi: f64, x_lo: f64, x_hi: f64, ) -> Option<PeopleWindow>

A window from a host’s four numbers, or None (every person) when one is not finite or a range is empty, so a host that sends nonsense gets the whole crowd instead of an empty frame.

Source

pub fn padded(self, transports: &[Transport]) -> PeopleWindow

The window as a frame tests people against: FLOOR_PAD floors past each edge, and half the widest shaft plus one tile past each side. A rider stands at their shaft’s middle, so a car whose edge is on screen has its middle at most half its width outside, and every rider of a car the view shows is in the frame.

Source

pub fn holds(&self, p: &Person) -> bool

Whether p is in the window as it stands (pads already added).

Trait Implementations§

Source§

impl Clone for PeopleWindow

Source§

fn clone(&self) -> PeopleWindow

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PeopleWindow

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for PeopleWindow

Source§

fn eq(&self, other: &PeopleWindow) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for PeopleWindow

Source§

impl StructuralPartialEq for PeopleWindow

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.