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

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Feeds this value into the given Hasher. Read more

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

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.