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: f64The lowest floor shown.
floor_hi: f64The highest floor shown.
x_lo: f64The leftmost tile shown.
x_hi: f64The rightmost tile shown.
Implementations§
Source§impl PeopleWindow
impl PeopleWindow
Sourcepub fn new(
floor_lo: f64,
floor_hi: f64,
x_lo: f64,
x_hi: f64,
) -> Option<PeopleWindow>
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.
Sourcepub fn padded(self, transports: &[Transport]) -> PeopleWindow
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.
Trait Implementations§
Source§impl Clone for PeopleWindow
impl Clone for PeopleWindow
Source§fn clone(&self) -> PeopleWindow
fn clone(&self) -> PeopleWindow
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PeopleWindow
impl Debug for PeopleWindow
Source§impl PartialEq for PeopleWindow
impl PartialEq for PeopleWindow
Source§fn eq(&self, other: &PeopleWindow) -> bool
fn eq(&self, other: &PeopleWindow) -> bool
self and other values to be equal, and is used by ==.