#[non_exhaustive]pub enum RiderPhase {
Waiting,
Boarding(EntityId),
Riding(EntityId),
Exiting(EntityId),
Walking,
Arrived,
Abandoned,
Resident,
}Expand description
Lifecycle phase of a rider entity.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Waiting
Waiting at a stop.
Boarding(EntityId)
Boarding an elevator (transient, one tick).
Riding(EntityId)
Riding in an elevator.
Exiting(EntityId)
Exiting an elevator (transient, one tick).
Walking
Walking between transfer stops.
Arrived
Reached final destination.
Abandoned
Gave up waiting.
Resident
Parked at a stop, not seeking an elevator.
Implementations§
Source§impl RiderPhase
impl RiderPhase
Sourcepub const fn is_aboard(&self) -> bool
pub const fn is_aboard(&self) -> bool
True when the rider is currently inside or transitioning through an
elevator cab — i.e., Boarding,
Riding, or Exiting.
Useful for code that needs to treat all three mid-elevator phases
uniformly (rendering, per-elevator population counts, skipping
stop-queue updates) without writing a three-arm match.
Sourcepub const fn is_at_stop(&self) -> bool
pub const fn is_at_stop(&self) -> bool
True when the rider is currently at a stop — i.e., one of the
phases for which Rider::current_stop is expected to be Some:
Waiting, Boarding,
Exiting, Arrived,
Abandoned, or Resident.
Companion to is_aboard. Note Boarding and
Exiting are both aboard and at a stop: the rider is mid-transfer
between a stop and an elevator cab.
Source§impl RiderPhase
impl RiderPhase
Sourcepub const fn kind(&self) -> RiderPhaseKind
pub const fn kind(&self) -> RiderPhaseKind
Return the data-less kind of this phase.
Trait Implementations§
Source§impl Clone for RiderPhase
impl Clone for RiderPhase
Source§fn clone(&self) -> RiderPhase
fn clone(&self) -> RiderPhase
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RiderPhase
impl Debug for RiderPhase
Source§impl<'de> Deserialize<'de> for RiderPhase
impl<'de> Deserialize<'de> for RiderPhase
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>,
Source§impl Display for RiderPhase
impl Display for RiderPhase
Source§impl PartialEq for RiderPhase
impl PartialEq for RiderPhase
Source§impl Serialize for RiderPhase
impl Serialize for RiderPhase
impl Copy for RiderPhase
impl Eq for RiderPhase
impl StructuralPartialEq for RiderPhase
Auto Trait Implementations§
impl Freeze for RiderPhase
impl RefUnwindSafe for RiderPhase
impl Send for RiderPhase
impl Sync for RiderPhase
impl Unpin for RiderPhase
impl UnsafeUnpin for RiderPhase
impl UnwindSafe for RiderPhase
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.