DayZ 1.24
Loading...
Searching...
No Matches
StomachItem Class Reference
Collaboration diagram for StomachItem:
[legend]

Private Member Functions

void StomachItem (string class_name, float amount, NutritionalProfile profile, int foodstage, int agents)
 
string GetClassName ()
 
int GetFoodStage ()
 
void SetFoodStage (int food_stage)
 
float GetAmount ()
 
void AddAmount (float amount)
 
void AddAgents (int agents)
 
bool ProcessDigestion (float digestion_points, out float water, out float energy, out float toxicity, out float volume, out int agents, out float consumed_amount)
 
float GetNutritions (float digestion_points, NutritionalProfile profile, out float water, out float energy, out float toxicity)
 

Private Attributes

ref NutritionalProfile m_Profile
 
float m_Amount
 
int m_FoodStage
 
string m_ClassName
 
int m_Agents
 

Detailed Description

Definition at line 1 of file PlayerStomach.c.

Constructor & Destructor Documentation

◆ StomachItem()

void StomachItem::StomachItem ( string class_name,
float amount,
NutritionalProfile profile,
int foodstage,
int agents )
inlineprivate

Definition at line 10 of file PlayerStomach.c.

11 {
12 m_Amount = amount;
14 //m_IsLiquid = is_liquid;
18 }
class OptionSelectorMultistate extends OptionSelector class_name
ref NutritionalProfile m_Profile
string m_ClassName

References class_name, m_Agents, m_Amount, m_ClassName, m_FoodStage, and m_Profile.

Member Function Documentation

◆ AddAgents()

void StomachItem::AddAgents ( int agents)
inlineprivate

Definition at line 59 of file PlayerStomach.c.

60 {
62 }

References m_Agents.

◆ AddAmount()

void StomachItem::AddAmount ( float amount)
inlineprivate

Definition at line 54 of file PlayerStomach.c.

55 {
56 m_Amount += amount;
57 }

References m_Amount.

◆ GetAmount()

float StomachItem::GetAmount ( )
inlineprivate

Definition at line 48 of file PlayerStomach.c.

49 {
50 return m_Amount;
51 }

References m_Amount.

◆ GetClassName()

string StomachItem::GetClassName ( )
inlineprivate

Definition at line 20 of file PlayerStomach.c.

21 {
22 return m_ClassName;
23 }

References m_ClassName.

◆ GetFoodStage()

int StomachItem::GetFoodStage ( )
inlineprivate

Definition at line 37 of file PlayerStomach.c.

38 {
39 return m_FoodStage;
40 }

References m_FoodStage.

◆ GetNutritions()

float StomachItem::GetNutritions ( float digestion_points,
NutritionalProfile profile,
out float water,
out float energy,
out float toxicity )
inlineprivate

Definition at line 75 of file PlayerStomach.c.

76 {
77 float energy_per_unit = profile.GetEnergy() / 100;
78 float water_per_unit = profile.GetWaterContent() / 100;
79 float toxicity_per_unit = profile.GetToxicity();
80 float digestability = profile.GetDigestibility();
81
82 if (digestability == 0) //if undefined
83 digestability = 1;
84
86
89 if (consumed_quantity > 0)
90 {
94 }
95 return consumed_quantity;
96 }

References m_Amount.

Referenced by ProcessDigestion().

◆ ProcessDigestion()

bool StomachItem::ProcessDigestion ( float digestion_points,
out float water,
out float energy,
out float toxicity,
out float volume,
out int agents,
out float consumed_amount )
inlineprivate

Definition at line 66 of file PlayerStomach.c.

67 {
71 volume = m_Profile.GetFullnessIndex() * m_Amount;
72 return (m_Amount < 0.001);
73 }
float GetNutritions(float digestion_points, NutritionalProfile profile, out float water, out float energy, out float toxicity)

References GetNutritions(), m_Agents, m_Amount, and m_Profile.

◆ SetFoodStage()

void StomachItem::SetFoodStage ( int food_stage)
inlineprivate

Definition at line 42 of file PlayerStomach.c.

43 {
45 }

References m_FoodStage.

Member Data Documentation

◆ m_Agents

int StomachItem::m_Agents
private

Definition at line 8 of file PlayerStomach.c.

Referenced by AddAgents(), ProcessDigestion(), and StomachItem().

◆ m_Amount

float StomachItem::m_Amount
private

Definition at line 4 of file PlayerStomach.c.

Referenced by AddAmount(), GetAmount(), GetNutritions(), ProcessDigestion(), and StomachItem().

◆ m_ClassName

string StomachItem::m_ClassName
private

Definition at line 7 of file PlayerStomach.c.

Referenced by GetClassName(), and StomachItem().

◆ m_FoodStage

int StomachItem::m_FoodStage
private

Definition at line 5 of file PlayerStomach.c.

Referenced by GetFoodStage(), SetFoodStage(), and StomachItem().

◆ m_Profile

ref NutritionalProfile StomachItem::m_Profile
private

Definition at line 3 of file PlayerStomach.c.

Referenced by ProcessDigestion(), and StomachItem().


The documentation for this class was generated from the following file: