DayZ 1.26
DayZ Explorer by KGB
Загрузка...
Поиск...
Не найдено
Класс UniversalTemperatureSourceLambdaBaseImpl
+ Граф наследования:UniversalTemperatureSourceLambdaBaseImpl:

Защищенные члены

void UpdateVicinityTemperatureRecursive (EntityAI ent, TemperatureData dta, float heatPermeabilityCoef=1.0)
 
override void Execute (UniversalTemperatureSourceSettings pSettings, UniversalTemperatureSourceResult resultValues)
 
override void DryItemsInVicinity (UniversalTemperatureSourceSettings pSettings)
 DEPRECATED.
 

Закрытые члены

override void DryItemsInVicinity (UniversalTemperatureSourceSettings pSettings, vector position, out notnull array< Object > nearestObjects)
 
override void WarmAndCoolItemsInVicinity (UniversalTemperatureSourceSettings pSettings, vector position, out notnull array< Object > nearestObjects)
 
- Закрытые члены унаследованные от UniversalTemperatureSourceLambdaBase
void UniversalTemperatureSourceLambdaBase ()
 
void ~UniversalTemperatureSourceLambdaBase ()
 
void Execute (UniversalTemperatureSourceSettings pSettings, UniversalTemperatureSourceResult resultValues)
 
void DryItemsInVicinity (UniversalTemperatureSourceSettings pSettings)
 
void DryItemsInVicinity (UniversalTemperatureSourceSettings pSettings, vector position, out notnull array< Object > nearestObjects)
 
void WarmAndCoolItemsInVicinity (UniversalTemperatureSourceSettings pSettings, vector position, out notnull array< Object > nearestObjects)
 
void OnBeforeExecute ()
 
void OnAfterExecute ()
 
void OnUTSActivate ()
 
void OnUTSDeactivate ()
 
bool AffectsPlayer ()
 

Дополнительные унаследованные члены

- Закрытые данные унаследованные от UniversalTemperatureSourceLambdaBase
float m_LastExecuteTime = -1
 
float m_ExecuteInterval = -1
 
bool m_AffectsPlayer
 
const float HEAT_THROUGH_AIR_COEF = 0.003
 

Подробное описание

Методы

◆ DryItemsInVicinity() [1/2]

override void DryItemsInVicinity ( UniversalTemperatureSourceSettings pSettings)
inlineprotected

DEPRECATED.

159 {
161
162 vector pos = pSettings.m_Position;
163 if (pSettings.m_Parent != null)
164 pos = pSettings.m_Parent.GetPosition();
165
166 GetGame().GetObjectsAtPosition(pos, pSettings.m_RangeMax, nearestObjects, null);
167
169 }
Definition EntityAI.c:95
override void DryItemsInVicinity(UniversalTemperatureSourceSettings pSettings, vector position, out notnull array< Object > nearestObjects)
Definition UniversalTemperatureSourceLambdaBaseImpl.c:3
Definition EnConvert.c:106
proto native CGame GetGame()

Перекрестные ссылки DryItemsInVicinity() и GetGame().

◆ DryItemsInVicinity() [2/2]

override void DryItemsInVicinity ( UniversalTemperatureSourceSettings pSettings,
vector position,
out notnull array< Object > nearestObjects )
inlineprivate

heat transfer to items (not in player possession)

4 {
6
8 {
10
12 if (nearestItem && nearestItem.HasWetness() && nearestItem != pSettings.m_Parent && !nearestItem.IsInherited(Man) && !nearestItem.IsUniversalTemperatureSource())
13 {
15 distanceToTemperatureSource = Math.Max(distanceToTemperatureSource, 0.1); //min distance cannot be 0 (division by zero)
16
17 float dryModifier = 0;
18
19 if (nearestItem.GetWet() >= GameConstants.STATE_DAMP)
20 {
21 dryModifier = (-1 * m_ExecuteInterval * nearestItem.GetDryingIncrement("groundHeatSource")) / distanceToTemperatureSource;
22 Math.Clamp(dryModifier, nearestItem.GetWetMin(), nearestItem.GetWetMax());
24 }
25
27 nearestItem.GetInventory().EnumerateInventory(InventoryTraversalType.INORDER, cargoEntities);
29 {
31 if (cargoItem)
32 {
33 dryModifier = 0;
34 if (cargoItem.GetWet() >= GameConstants.STATE_DAMP)
35 {
36 dryModifier = (-1 * m_ExecuteInterval * cargoItem.GetDryingIncrement("groundHeatSource")) / distanceToTemperatureSource;
37 Math.Clamp(dryModifier, cargoItem.GetWetMin(), cargoItem.GetWetMax());
38 cargoItem.AddWet(dryModifier);
39 }
40 }
41 }
42 }
43 }
44 }
Definition Building.c:6
Definition constants.c:638
Definition InventoryItem.c:731
Definition EnMath.c:7
Definition ObjectTyped.c:2
float m_ExecuteInterval
Definition UniversalTemperatureSourceLambdaBase.c:4
static proto native float Distance(vector v1, vector v2)
Returns the distance between tips of two 3D vectors.
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
Definition gameplay.c:6
const float STATE_DAMP
Definition constants.c:834
static proto float Max(float x, float y)
Returns bigger of two given values.
static proto float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.

Перекрестные ссылки Math::Clamp(), vector::Distance(), UniversalTemperatureSourceLambdaBase::m_ExecuteInterval, Math::Max() и GameConstants::STATE_DAMP.

Используется в DryItemsInVicinity() и Execute().

◆ Execute()

override void Execute ( UniversalTemperatureSourceSettings pSettings,
UniversalTemperatureSourceResult resultValues )
inlineprotected
140 {
141 resultValues.m_Temperature = pSettings.m_TemperatureMax;
142
144
145 vector pos = pSettings.m_Position;
146 if (pSettings.m_Parent != null)
147 pos = pSettings.m_Parent.GetPosition();
148
149 GetGame().GetObjectsAtPosition(pos, pSettings.m_RangeMax, nearestObjects, null);
150 if (nearestObjects.Count() > 0)
151 {
154 }
155 }
override void WarmAndCoolItemsInVicinity(UniversalTemperatureSourceSettings pSettings, vector position, out notnull array< Object > nearestObjects)
Definition UniversalTemperatureSourceLambdaBaseImpl.c:46

Перекрестные ссылки DryItemsInVicinity(), GetGame() и WarmAndCoolItemsInVicinity().

◆ UpdateVicinityTemperatureRecursive()

void UpdateVicinityTemperatureRecursive ( EntityAI ent,
TemperatureData dta,
float heatPermeabilityCoef = 1.0 )
inlineprotected
93 {
95 heatPermCoef *= ent.GetHeatPermeabilityCoef();
96 dta.m_HeatPermeabilityCoef = heatPermCoef;
97
98 //handle temperature of this entity
99 if (ent.CanHaveTemperature() && !ent.IsSelfAdjustingTemperature())
100 {
101 float temperatureDifference = dta.m_AdjustedTarget - ent.GetTemperature();
102 if (Math.AbsFloat(temperatureDifference) < GameConstants.TEMPERATURE_SENSITIVITY_THRESHOLD) //ignoring insignificant increments
103 ent.RefreshTemperatureAccess(dta);
104 else
105 ent.SetTemperatureEx(dta);
106 }
107
108 // go through any attachments and cargo, recursive
109 int inventoryAttCount = ent.GetInventory().AttachmentCount();
110 if (inventoryAttCount > 0)
111 {
113 for (int inAttIdx = 0; inAttIdx < inventoryAttCount; ++inAttIdx)
114 {
115 if (Class.CastTo(attachmentEnt,ent.GetInventory().GetAttachmentFromIndex(inAttIdx)))
116 {
118 }
119 }
120 }
121
122 if (ent.GetInventory().GetCargo())
123 {
124 int inventoryItemCount = ent.GetInventory().GetCargo().GetItemCount();
125 if (inventoryItemCount > 0)
126 {
128 for (int j = 0; j < inventoryItemCount; ++j)
129 {
130 if (Class.CastTo(cargoEnt,ent.GetInventory().GetCargo().GetItem(j)))
131 {
133 }
134 }
135 }
136 }
137 }
Super root of all classes in Enforce script.
Definition EnScript.c:11
void UpdateVicinityTemperatureRecursive(EntityAI ent, TemperatureData dta, float heatPermeabilityCoef=1.0)
Definition UniversalTemperatureSourceLambdaBaseImpl.c:92
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
static const float TEMPERATURE_SENSITIVITY_THRESHOLD
Definition constants.c:898
static proto float AbsFloat(float f)
Returns absolute value.

Перекрестные ссылки Math::AbsFloat(), Class::CastTo(), GameConstants::TEMPERATURE_SENSITIVITY_THRESHOLD и UpdateVicinityTemperatureRecursive().

Используется в UpdateVicinityTemperatureRecursive() и WarmAndCoolItemsInVicinity().

◆ WarmAndCoolItemsInVicinity()

override void WarmAndCoolItemsInVicinity ( UniversalTemperatureSourceSettings pSettings,
vector position,
out notnull array< Object > nearestObjects )
inlineprivate

dist factor minimum should be at 0

47 {
49 float tempTarget = pSettings.m_TemperatureItemCap;
52
54 {
55 if (Class.CastTo(nearestEntity,nearestObject) && nearestEntity != pSettings.m_Parent && !nearestEntity.IsSelfAdjustingTemperature())
56 {
57 float temperatureDifference = tempTarget - nearestEntity.GetTemperature();
58
61
62 float time = m_ExecuteInterval;
63 if (m_ExecuteInterval == -1) //bogus time in the first execute
64 time = 1;
65
66 float distFactor = 1;
67 if (vector.Distance(nearestEntity.GetPosition(), position) > pSettings.m_RangeFull)
68 {
71 }
72
74
75 if (nearestEntity.GetInventory())
76 {
78 }
79 else if (nearestEntity.CanHaveTemperature() && !nearestEntity.IsSelfAdjustingTemperature())
80 {
81 dta.m_HeatPermeabilityCoef = nearestEntity.GetHeatPermeabilityCoef();
82
84 nearestEntity.RefreshTemperatureAccess(dta);
85 else
86 nearestEntity.SetTemperatureEx(dta);
87 }
88 }
89 }
90 }
ETemperatureAccessTypes
Definition TemperatureAccessConstants.c:2
static proto float InverseLerp(float a, float b, float value)
Calculates the linear value that produces the interpolant value within the range [a,...

Перекрестные ссылки Math::AbsFloat(), Class::CastTo(), vector::Distance(), Math::InverseLerp(), UniversalTemperatureSourceLambdaBase::m_ExecuteInterval, Math::Max(), GameConstants::TEMPERATURE_SENSITIVITY_THRESHOLD и UpdateVicinityTemperatureRecursive().

Используется в Execute().


Объявления и описания членов класса находятся в файле: