pub(super) struct EntityRelationshipState {
pub(super) vehicle: Option<WeakEntity>,
pub(super) passengers: Vec<WeakEntity>,
pub(super) boarding_cooldown: i32,
}Expand description
Vanilla passenger and vehicle relationship state.
Stored separately from movement state because riding relationships affect collision, tracking, saving, and future pathfinding without being part of the entity’s physical pose/velocity snapshot.
Fields§
§vehicle: Option<WeakEntity>§passengers: Vec<WeakEntity>§boarding_cooldown: i32Implementations§
Source§impl EntityRelationshipState
impl EntityRelationshipState
pub(super) fn vehicle(&mut self) -> Option<SharedEntity>
pub(super) fn passengers(&mut self) -> Vec<SharedEntity> ⓘ
pub(super) fn first_passenger(&mut self) -> Option<SharedEntity>
pub(super) fn has_passenger_id(&mut self, passenger_id: i32) -> bool
pub(super) fn remove_passenger_id(&mut self, passenger_id: i32) -> bool
Trait Implementations§
Source§impl Default for EntityRelationshipState
impl Default for EntityRelationshipState
Source§fn default() -> EntityRelationshipState
fn default() -> EntityRelationshipState
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for EntityRelationshipState
impl !UnwindSafe for EntityRelationshipState
impl Freeze for EntityRelationshipState
impl Send for EntityRelationshipState
impl Sync for EntityRelationshipState
impl Unpin for EntityRelationshipState
impl UnsafeUnpin for EntityRelationshipState
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
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 moreWraps this value in an
Arc<SyncMutex<>>