pub struct Route {
pub legs: Vec<RouteLeg>,
pub current_leg: usize,
}Expand description
A rider’s full route, possibly spanning multiple elevator groups.
Fields§
§legs: Vec<RouteLeg>Ordered legs of the route.
current_leg: usizeIndex into legs for the leg currently being traversed.
Implementations§
Source§impl Route
impl Route
Sourcepub fn direct(from: EntityId, to: EntityId, group: GroupId) -> Self
pub fn direct(from: EntityId, to: EntityId, group: GroupId) -> Self
Create a direct single-leg route via one elevator group.
Sourcepub const fn advance(&mut self) -> bool
pub const fn advance(&mut self) -> bool
Advance to the next leg. Returns true if there are more legs.
Sourcepub const fn is_complete(&self) -> bool
pub const fn is_complete(&self) -> bool
Whether all legs have been completed.
Sourcepub fn current_destination(&self) -> Option<EntityId>
pub fn current_destination(&self) -> Option<EntityId>
The destination of the current leg.
Sourcepub fn final_destination(&self) -> Option<EntityId>
pub fn final_destination(&self) -> Option<EntityId>
The final destination of the entire route.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Route
impl<'de> Deserialize<'de> for Route
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl WorldQuery for &Route
impl WorldQuery for &Route
Auto Trait Implementations§
impl Freeze for Route
impl RefUnwindSafe for Route
impl Send for Route
impl Sync for Route
impl Unpin for Route
impl UnsafeUnpin for Route
impl UnwindSafe for Route
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