pub struct ExhaustRate {
pub health: f32,
pub hunger: f32,
pub thirst: f32,
}Expand description
A triple rate affecting health, hunger, and thirst respectively.
Each activity (moving, swimming, jumping, attacking) consumes health, hunger, and thirst at different rates. This struct holds one set of rates for a single activity.
Fields§
§health: f32Rate of health consumption.
hunger: f32Rate of hunger consumption.
thirst: f32Rate of thirst consumption.
Implementations§
Source§impl ExhaustRate
impl ExhaustRate
Sourcepub fn from_inf(s: &str) -> Option<ExhaustRate>
pub fn from_inf(s: &str) -> Option<ExhaustRate>
Parse from a comma-separated triple string e.g. "0.02,0.02,0.016".
Trait Implementations§
Source§impl Clone for ExhaustRate
impl Clone for ExhaustRate
Source§fn clone(&self) -> ExhaustRate
fn clone(&self) -> ExhaustRate
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ExhaustRate
Source§impl Debug for ExhaustRate
impl Debug for ExhaustRate
Source§impl Default for ExhaustRate
impl Default for ExhaustRate
Source§fn default() -> ExhaustRate
fn default() -> ExhaustRate
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ExhaustRate
impl<'de> Deserialize<'de> for ExhaustRate
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ExhaustRate, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ExhaustRate, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ExhaustRate
impl PartialEq for ExhaustRate
Source§impl Serialize for ExhaustRate
impl Serialize for ExhaustRate
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for ExhaustRate
Auto Trait Implementations§
impl Forget for ExhaustRate
impl Freeze for ExhaustRate
impl Move for ExhaustRate
impl RefUnwindSafe for ExhaustRate
impl Send for ExhaustRate
impl Sync for ExhaustRate
impl Unpin for ExhaustRate
impl UnsafeUnpin for ExhaustRate
impl UnwindSafe for ExhaustRate
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more