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:
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.
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.
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.
Returns the "default value" for a type. Read more
This method tests for self
and other
values to be equal, and is used by ==
. Read more
This method tests for !=
.
Performs copy-assignment from source
. Read more
Formats the value using the given formatter. Read more
Feeds this value into the given [Hasher
]. Read more
Feeds a slice of this type into the given [Hasher
]. Read more
Serialize this value into the given Serde serializer. Read more
Deserialize this value from the given Serde deserializer. Read more
Creates owned data from borrowed data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static