Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
universaltemperaturesourcelambdafireplace.c
Go to the documentation of this file.
2 {
3  int m_FuelCount;
4  int m_SmallFireplaceTemperatureMax;
5  int m_NormalFireplaceTemperatureMax;
6  float m_Temperature;
7 
9  {
10  m_FuelCount = 0;
11  m_SmallFireplaceTemperatureMax = 0;
12  m_NormalFireplaceTemperatureMax = 0;
13  m_Temperature = 0;
14  }
15 
16  void SetSmallFireplaceTemperatureMax(int value)
17  {
18  m_SmallFireplaceTemperatureMax = value;
19  }
20 
21  void SetNormalFireplaceTemperatureMax(int value)
22  {
23  m_NormalFireplaceTemperatureMax = value;
24  }
25 
26  void SetFuelCount(int value)
27  {
28  m_FuelCount = value;
29  }
30 
31  void SetCurrentTemperature(float temperature)
32  {
33  //no fuel present, temperature should be low but there can be high temperature from previous fuel burning
34  if (m_FuelCount == 0 || temperature <= m_SmallFireplaceTemperatureMax)
35  {
36  temperature = Math.Clamp(temperature, 0, m_SmallFireplaceTemperatureMax); //small fire
37  }
38  else
39  {
40  temperature = Math.Clamp(temperature, 0, m_NormalFireplaceTemperatureMax); //normal fire
41  }
42 
43  m_Temperature = temperature;
44  }
45 
46  override void Execute(UniversalTemperatureSourceSettings pSettings, UniversalTemperatureSourceResult resultValues)
47  {
48  resultValues.m_Temperature = m_Temperature;
49  //Debug.Log(string.Format("Execute: temperature: %1", resultValues.m_Temperature), "UTS Fireplace");
50 
51  if (pSettings.m_AffectStat)
52  {
54  pSettings.m_Parent.SetTemperature(m_Temperature);
55  }
56 
57  DryItemsInVicinity(pSettings);
58  }
59 }
UniversalTemperatureSourceLambdaFireplace
Definition: universaltemperaturesourcelambdafireplace.c:1
m_Temperature
class UniversalTemperatureSourceSettings m_Temperature
UniversalTemperatureSourceLambdaBaseImpl
Definition: universaltemperaturesourcelambdabaseimpl.c:1
DryItemsInVicinity
override void DryItemsInVicinity(UniversalTemperatureSourceSettings pSettings)
Definition: universaltemperaturesourcelambdabaseimpl.c:2
UniversalTemperatureSourceSettings
Definition: universaltemperaturesource.c:1
Math
Definition: enmath.c:6