pub trait ItemSteerable: Entity {
// Required methods
fn item_based_steering(&self) -> &SyncMutex<ItemBasedSteering>;
fn boost_time_total(&self) -> i32;
fn set_boost_time_total(&self, boost_time_total: i32);
// Provided methods
fn boost(&self) -> bool { ... }
fn tick_boost(&self) { ... }
fn boost_factor(&self) -> f32 { ... }
}Expand description
Entity behavior for vehicles that gain a temporary speed boost from an item, such as a saddled pig steered with a carrot on a stick.
Required Methods§
Sourcefn item_based_steering(&self) -> &SyncMutex<ItemBasedSteering>
fn item_based_steering(&self) -> &SyncMutex<ItemBasedSteering>
Returns the shared runtime steering state.
Sourcefn boost_time_total(&self) -> i32
fn boost_time_total(&self) -> i32
Returns the synced total boost duration in ticks for the currently active boost.
Sourcefn set_boost_time_total(&self, boost_time_total: i32)
fn set_boost_time_total(&self, boost_time_total: i32)
Sets the synced total boost duration in ticks for the currently active boost.
Provided Methods§
Sourcefn tick_boost(&self)
fn tick_boost(&self)
Advances the active item-steering boost.
Sourcefn boost_factor(&self) -> f32
fn boost_factor(&self) -> f32
Returns the current speed multiplier while boosting; 1.0 when not boosting.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".