elevator_core/components/stop.rs
1//! Stop (floor/station) component.
2
3use serde::{Deserialize, Serialize};
4
5/// Component for a stop (floor/station) entity.
6#[derive(Debug, Clone, Serialize, Deserialize)]
7pub struct Stop {
8 /// Human-readable stop name.
9 pub(crate) name: String,
10 /// Absolute position along the shaft axis.
11 pub(crate) position: f64,
12}
13
14impl Stop {
15 /// Human-readable stop name.
16 #[must_use]
17 pub fn name(&self) -> &str {
18 &self.name
19 }
20
21 /// Absolute position along the shaft axis.
22 #[must_use]
23 pub const fn position(&self) -> f64 {
24 self.position
25 }
26}