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

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

void CAContinuousWaterSlot (float quantity_used_per_second)
 
override void Setup (ActionData action_data)
 
override int Execute (ActionData action_data)
 
override float GetProgress ()
 

Защищенные данные

float m_PlantThirstyness
 
float m_TimeToComplete
 
float m_SpentQuantityTotal
 
float m_StartQuantity
 
Slot m_Slot
 

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

- Закрытые члены унаследованные от CAContinuousQuantity
void CAContinuousQuantity (float quantity_used_per_second)
 
override void Setup (ActionData action_data)
 
override int Execute (ActionData action_data)
 
override int Cancel (ActionData action_data)
 
override float GetProgress ()
 
void CalcAndSetQuantity (ActionData action_data)
 
- Закрытые данные унаследованные от CAContinuousQuantity
float m_ItemQuantity
 
float m_SpentQuantity
 
float m_ItemMaxQuantity
 
float m_QuantityUsedPerSecond
 
float m_AdjustedQuantityUsedPerSecond
 
ref Param1< floatm_SpentUnits
 

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

Конструктор(ы)

◆ CAContinuousWaterSlot()

void CAContinuousWaterSlot ( float quantity_used_per_second)
inlineprotected
10 {
12 }
float m_QuantityUsedPerSecond
Definition CAContinuousQuantity.c:6
Definition EntityAI.c:95

Перекрестные ссылки CAContinuousQuantity::m_QuantityUsedPerSecond.

Методы

◆ Execute()

override int Execute ( ActionData action_data)
inlineprotected
60 {
62 Class.CastTo(target_GB, action_data.m_Target.GetObject() );
63 m_ItemQuantity = action_data.m_MainItem.GetQuantity();
64 m_ItemMaxQuantity = action_data.m_MainItem.GetQuantityMax();
65
66 if ( !action_data.m_Player )
67 {
68 return UA_ERROR;
69 }
70
71 if ( m_ItemQuantity <= 0 )
72 {
73 return UA_FINISHED;
74 }
75 else
76 {
78 {
79 m_SpentQuantity += m_QuantityUsedPerSecond * action_data.m_Player.GetDeltaT();
80 if (m_SpentQuantity > m_ItemQuantity) // dont transfer more water than the source's quantity
82
83 m_Slot.GiveWater( m_SpentQuantity );
84
87
89
90 return UA_PROCESSING;
91 }
92 else
93 {
96
97 return UA_FINISHED;
98 }
99 }
100 }
void CalcAndSetQuantity()
Definition FireplaceBase.c:2601
void OnCompletePogress(ActionData action_data)
Definition CAContinuousBase.c:8
float m_SpentQuantity
Definition CAContinuousQuantity.c:4
float m_ItemQuantity
Definition CAContinuousQuantity.c:3
float m_ItemMaxQuantity
Definition CAContinuousQuantity.c:5
Slot m_Slot
Definition CAContinuousWaterSlot.c:7
float m_SpentQuantityTotal
Definition CAContinuousWaterSlot.c:5
Super root of all classes in Enforce script.
Definition EnScript.c:11
Definition GardenPlot.c:2
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
const int UA_FINISHED
Definition constants.c:443
const int UA_ERROR
Definition constants.c:462
const int UA_PROCESSING
Definition constants.c:441

Перекрестные ссылки CalcAndSetQuantity(), Class::CastTo(), CAContinuousQuantity::m_ItemMaxQuantity, CAContinuousQuantity::m_ItemQuantity, CAContinuousQuantity::m_QuantityUsedPerSecond, m_Slot, CAContinuousQuantity::m_SpentQuantity, m_SpentQuantityTotal, CAContinuousBase::OnCompletePogress(), UA_ERROR, UA_FINISHED и UA_PROCESSING.

◆ GetProgress()

override float GetProgress ( )
inlineprotected
103 {
104 if ( m_ItemQuantity <= 0 )
105 return 1;
107 return progress;
108 }
float m_StartQuantity
Definition CAContinuousWaterSlot.c:6

Перекрестные ссылки CAContinuousQuantity::m_ItemQuantity, m_SpentQuantityTotal и m_StartQuantity.

◆ Setup()

override void Setup ( ActionData action_data)
inlineprotected
15 {
17
18 if ( Class.CastTo(target_GB, action_data.m_Target.GetObject()) )
19 {
21 m_StartQuantity = action_data.m_MainItem.GetQuantity();
22 if ( !m_SpentUnits )
23 {
25 }
26 else
27 {
28 m_SpentUnits.param1 = 0;
29 }
30
31 if ( action_data.m_MainItem )
32 m_ItemQuantity = action_data.m_MainItem.GetQuantity();
33
34 if ( target_GB )
35 {
37 target_GB.GetActionComponentNameList(action_data.m_Target.GetComponentIndex(), selections);
38
39 for (int s = 0; s < selections.Count(); s++)
40 {
41 string selection = selections[s];
42 m_Slot = target_GB.GetSlotBySelection( selection );
43 if (m_Slot)
44 break;
45 }
46
47 m_PlantThirstyness = m_Slot.GetWaterUsage() - m_Slot.GetWater();
48 }
49
51
52 if (m_TimeToComplete <= 0.1) // Division by zero prevention
53 {
54 m_TimeToComplete = 0.1;
55 }
56 }
57 }
ref Param1< float > m_SpentUnits
Definition CAContinuousQuantity.c:8
float m_TimeToComplete
Definition CAContinuousWaterSlot.c:4
float m_PlantThirstyness
Definition CAContinuousWaterSlot.c:3
Definition EnMath.c:7
static proto float Min(float x, float y)
Returns smaller of two given values.

Перекрестные ссылки Class::CastTo(), CAContinuousQuantity::m_ItemQuantity, m_PlantThirstyness, CAContinuousQuantity::m_QuantityUsedPerSecond, m_Slot, CAContinuousQuantity::m_SpentQuantity, CAContinuousQuantity::m_SpentUnits, m_StartQuantity, m_TimeToComplete и Math::Min().

Поля

◆ m_PlantThirstyness

float m_PlantThirstyness
protected

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

◆ m_Slot

Slot m_Slot
protected

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

◆ m_SpentQuantityTotal

float m_SpentQuantityTotal
protected

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

◆ m_StartQuantity

float m_StartQuantity
protected

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

◆ m_TimeToComplete

float m_TimeToComplete
protected

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


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