Skip to main content

ItemSteerable

Trait ItemSteerable 

Source
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§

Source

fn item_based_steering(&self) -> &SyncMutex<ItemBasedSteering>

Returns the shared runtime steering state.

Source

fn boost_time_total(&self) -> i32

Returns the synced total boost duration in ticks for the currently active boost.

Source

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§

Source

fn boost(&self) -> bool

Attempts to start an item-steering boost.

Source

fn tick_boost(&self)

Advances the active item-steering boost.

Source

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".

Implementors§