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

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

override void DryItemsInVicinity (UniversalTemperatureSourceSettings pSettings)
 

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

Методы

◆ DryItemsInVicinity()

override void DryItemsInVicinity ( UniversalTemperatureSourceSettings pSettings)
inlineprivate

heat transfer to items (no in player possession)

4 {
5 float distance;
7
8 vector pos = pSettings.m_Position;
9 if (pSettings.m_Parent != null)
10 pos = pSettings.m_Parent.GetPosition();
11
12 GetGame().GetObjectsAtPosition(pos, pSettings.m_RangeMax, nearestObjects, null);
14 {
17 if (nearestItem && nearestItem.HasWetness() && nearestItem != pSettings.m_Parent && !nearestItem.IsInherited(Man))
18 {
19 distance = vector.Distance(nearestItem.GetPosition(), pSettings.m_Position);
20 distance = Math.Max(distance, 0.1); //min distance cannot be 0 (division by zero)
21
22 float dryModifier = 0;
23
24 if (nearestItem.GetWet() >= GameConstants.STATE_DAMP)
25 {
26 dryModifier = (-1 * pSettings.m_UpdateInterval * nearestItem.GetDryingIncrement("groundHeatSource")) / distance;
27 Math.Clamp(dryModifier, nearestItem.GetWetMin(), nearestItem.GetWetMax());
29 }
30
32 nearestItem.GetInventory().EnumerateInventory(InventoryTraversalType.INORDER, cargoEntities);
34 {
36 if (cargoItem)
37 {
38 dryModifier = 0;
39 if (cargoItem.GetWet() >= GameConstants.STATE_DAMP)
40 {
41 dryModifier = (-1 * pSettings.m_UpdateInterval * cargoItem.GetDryingIncrement("groundHeatSource")) / distance;
42 Math.Clamp(dryModifier, cargoItem.GetWetMin(), cargoItem.GetWetMax());
43 cargoItem.AddWet(dryModifier);
44 }
45 }
46 }
47 }
48 }
49 }
Definition Building.c:6
Definition constants.c:615
Definition InventoryItem.c:731
Definition EnMath.c:7
Definition ObjectTyped.c:2
Definition EntityAI.c:95
Definition EnConvert.c:106
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
proto native CGame GetGame()
const float STATE_DAMP
Definition constants.c:787
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(), GetGame(), Math::Max() и GameConstants::STATE_DAMP.

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


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