pub struct SurvivalParams {
pub health_system: HealthSystem,
pub exhaust: ExhaustParams,
pub exhausted_damage: [f32; 3],
pub dive: DiveParams,
pub jump: JumpParams,
}Expand description
All survival-related parameters extracted from game.inf.
§.inf fields consumed
| Field | Maps to |
|---|---|
healthsystem | HealthSystem |
exhaust_move | ExhaustParams::move_rate |
exhaust_swim | ExhaustParams::swim_rate |
exhaust_jump | ExhaustParams::jump_rate |
exhaust_attack | ExhaustParams::attack_rate |
exhausted_damage | damage when exhausted (health, hunger, thirst) |
dive_time | DiveParams::time |
dive_damage | DiveParams::damage |
jumptime | JumpParams::time |
jumpfactor | JumpParams::factor |
Fields§
§health_system: HealthSystemHealth system complexity level.
exhaust: ExhaustParamsExhaustion rates for various actions.
exhausted_damage: [f32; 3]Damage applied when exhausted — [health, hunger, thirst].
dive: DiveParamsDiving parameters.
jump: JumpParamsJump parameters.
Implementations§
Source§impl SurvivalParams
impl SurvivalParams
Sourcepub fn from_inf_fields(
fields: &HashMap<String, Vec<String>>,
) -> Option<SurvivalParams>
pub fn from_inf_fields( fields: &HashMap<String, Vec<String>>, ) -> Option<SurvivalParams>
Construct SurvivalParams from the raw fields of a parsed
game.inf entry.
Only survival-related fields are extracted; other game configuration fields are silently ignored.
Trait Implementations§
Source§impl Clone for SurvivalParams
impl Clone for SurvivalParams
Source§fn clone(&self) -> SurvivalParams
fn clone(&self) -> SurvivalParams
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 SurvivalParams
Source§impl Debug for SurvivalParams
impl Debug for SurvivalParams
Source§impl Default for SurvivalParams
impl Default for SurvivalParams
Source§fn default() -> SurvivalParams
fn default() -> SurvivalParams
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for SurvivalParams
impl<'de> Deserialize<'de> for SurvivalParams
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<SurvivalParams, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<SurvivalParams, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for SurvivalParams
impl PartialEq for SurvivalParams
Source§impl Serialize for SurvivalParams
impl Serialize for SurvivalParams
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 SurvivalParams
Auto Trait Implementations§
impl Forget for SurvivalParams
impl Freeze for SurvivalParams
impl Move for SurvivalParams
impl RefUnwindSafe for SurvivalParams
impl Send for SurvivalParams
impl Sync for SurvivalParams
impl Unpin for SurvivalParams
impl UnsafeUnpin for SurvivalParams
impl UnwindSafe for SurvivalParams
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