#[non_exhaustive]pub enum BuiltinReposition {
SpreadEvenly,
ReturnToLobby,
DemandWeighted,
NearestIdle,
Custom(String),
}Expand description
Serializable identifier for built-in repositioning strategies.
Used in config and snapshots to restore the correct strategy.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
SpreadEvenly
Distribute idle elevators evenly across stops.
ReturnToLobby
Return idle elevators to a configured home stop.
DemandWeighted
Position near stops with historically high demand.
NearestIdle
Keep idle elevators where they are (no-op).
Custom(String)
Custom strategy identified by name.
Implementations§
Source§impl BuiltinReposition
impl BuiltinReposition
Sourcepub fn instantiate(&self) -> Option<Box<dyn RepositionStrategy>>
pub fn instantiate(&self) -> Option<Box<dyn RepositionStrategy>>
Instantiate the reposition strategy for this variant.
Returns None for Custom — the game must provide those via
a factory function. ReturnToLobby uses stop index 0 as default.
Trait Implementations§
Source§impl Clone for BuiltinReposition
impl Clone for BuiltinReposition
Source§fn clone(&self) -> BuiltinReposition
fn clone(&self) -> BuiltinReposition
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BuiltinReposition
impl Debug for BuiltinReposition
Source§impl<'de> Deserialize<'de> for BuiltinReposition
impl<'de> Deserialize<'de> for BuiltinReposition
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 Display for BuiltinReposition
impl Display for BuiltinReposition
Source§impl PartialEq for BuiltinReposition
impl PartialEq for BuiltinReposition
Source§impl Serialize for BuiltinReposition
impl Serialize for BuiltinReposition
impl Eq for BuiltinReposition
impl StructuralPartialEq for BuiltinReposition
Auto Trait Implementations§
impl Freeze for BuiltinReposition
impl RefUnwindSafe for BuiltinReposition
impl Send for BuiltinReposition
impl Sync for BuiltinReposition
impl Unpin for BuiltinReposition
impl UnsafeUnpin for BuiltinReposition
impl UnwindSafe for BuiltinReposition
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