[][src]Struct airmash_protocol::Upgrades

pub struct Upgrades {
    pub speed: u8,
    pub shield: bool,
    pub inferno: bool,
}

Upgrade info that a client needs to know about to calculate movement. This also includes the shielded state of the player.

Note that since a player should never have more than 5 upgrades on the official server, protocol-v5 can only represent amounts of speed upgrades in the range 0 to 7.

Used in:

Fields

speed: u8

The number of speed upgrades that the player currently has equipped.

Note that only the first 3 bits of this are used in protocol-v5. Any values greater than 7 will be mangled.

shield: bool

Whether the player has a shield.

While both this and inferno can be set at the same time, that doesn't make sense within the framework of the game.

inferno: bool

Whether the player has an inferno.

While both this and shield can be set at the same time, that doesn't make sense within the framework of the game.

Trait Implementations

impl PartialEq<Upgrades> for Upgrades
[src]

impl Eq for Upgrades
[src]

impl Clone for Upgrades
[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Default for Upgrades
[src]

impl Copy for Upgrades
[src]

impl Debug for Upgrades
[src]

impl Hash for Upgrades
[src]

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl Serialize for Upgrades
[src]

impl<'de> Deserialize<'de> for Upgrades
[src]

Auto Trait Implementations

impl Send for Upgrades

impl Sync for Upgrades

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for T
[src]

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> Same for T

type Output = T

Should always be Self

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]