diff options
Diffstat (limited to 'crates/fparkan-runtime/src/boarding.rs')
| -rw-r--r-- | crates/fparkan-runtime/src/boarding.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/crates/fparkan-runtime/src/boarding.rs b/crates/fparkan-runtime/src/boarding.rs index c1b3651e..9d15fedd 100644 --- a/crates/fparkan-runtime/src/boarding.rs +++ b/crates/fparkan-runtime/src/boarding.rs @@ -20,6 +20,14 @@ pub struct VehicleEntry { pub cockpit: Option<StartingCockpit>, } +impl VehicleEntry { + /// Captures that leave the player outside the machine receive a spoken acknowledgement. + pub fn capture_notice(&self) -> Option<crate::MissionNotice> { + (self.captured.is_some() && self.cockpit.is_none()) + .then_some(crate::MissionNotice::VehicleCaptured) + } +} + #[derive(Clone, Copy)] pub(super) struct Boarding { pub(super) cockpit: StartingCockpit, @@ -248,6 +256,7 @@ mod tests { let entry = enter_vehicle(&mut engine, hero, None).unwrap(); assert_eq!(entry.captured, Some(id)); assert_eq!(entry.cockpit.unwrap().handle, target); + assert_eq!(entry.capture_notice(), None); assert_eq!(player_vehicle(&engine), entry.cockpit); } } |
