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

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

void CAContinuousWaterPlant (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
 

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

- Закрытые члены унаследованные от 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
 

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

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

◆ CAContinuousWaterPlant()

void CAContinuousWaterPlant ( float quantity_used_per_second)
inlineprotected
7 {
9 }
float m_QuantityUsedPerSecond
Definition CAContinuousQuantity.c:6
Definition EntityAI.c:95

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

Методы

◆ Execute()

override int Execute ( ActionData action_data)
inlineprotected
39 {
40 if ( !action_data.m_Player )
41 {
42 return UA_ERROR;
43 }
44
45 if ( m_ItemQuantity <= 0 )
46 {
47 return UA_FINISHED;
48 }
49 else
50 {
52 {
53 m_AdjustedQuantityUsedPerSecond = action_data.m_Player.GetSoftSkillsManager().AddSpecialtyBonus( m_QuantityUsedPerSecond, m_Action.GetSpecialtyWeight(), true);
54 m_SpentQuantity += m_QuantityUsedPerSecond * action_data.m_Player.GetDeltaT();
55
56 if ( m_Action )
57 {
58 PlantBase plant;
59 Class.CastTo(plant, action_data.m_Target.GetObject() );
60 Slot slot = plant.GetSlot();
61 slot.GiveWater( m_SpentQuantity );
62 }
63 return UA_PROCESSING;
64 }
65 else
66 {
69 return UA_FINISHED;
70 }
71 }
72 }
void CalcAndSetQuantity()
Definition FireplaceBase.c:2622
ActionBase m_Action
Definition CABase.c:3
void OnCompletePogress(ActionData action_data)
Definition CAContinuousBase.c:8
float m_AdjustedQuantityUsedPerSecond
Definition CAContinuousQuantity.c:7
float m_SpentQuantity
Definition CAContinuousQuantity.c:4
float m_ItemQuantity
Definition CAContinuousQuantity.c:3
float m_PlantThirstyness
Definition CAContinuousWaterPlant.c:3
Super root of all classes in Enforce script.
Definition EnScript.c:11
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:436
const int UA_ERROR
Definition constants.c:455
const int UA_PROCESSING
Definition constants.c:434

Перекрестные ссылки CalcAndSetQuantity(), Class::CastTo(), CABase::m_Action, CAContinuousQuantity::m_AdjustedQuantityUsedPerSecond, CAContinuousQuantity::m_ItemQuantity, m_PlantThirstyness, CAContinuousQuantity::m_QuantityUsedPerSecond, CAContinuousQuantity::m_SpentQuantity, CAContinuousBase::OnCompletePogress(), UA_ERROR, UA_FINISHED и UA_PROCESSING.

◆ GetProgress()

override float GetProgress ( )
inlineprotected
75 {
76 //float progress = (m_SpentQuantity*m_QuantityUsedPerSecond)/m_TimeToComplete;
78 }
float m_TimeToComplete
Definition CAContinuousWaterPlant.c:4

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

◆ Setup()

override void Setup ( ActionData action_data)
inlineprotected
12 {
13 PlantBase target_PB;
14 if (Class.CastTo(target_PB, action_data.m_Target.GetObject()))
15 {
17 if ( !m_SpentUnits )
18 {
20 }
21 else
22 {
23 m_SpentUnits.param1 = 0;
24 }
25 if ( action_data.m_MainItem )
26 {
27 m_ItemQuantity = action_data.m_MainItem.GetQuantity();
28 }
29 if ( target_PB )
30 {
31 m_PlantThirstyness = target_PB.GetWaterMax() - target_PB.GetWater();
32 }
33
35 }
36 }
ref Param1< float > m_SpentUnits
Definition CAContinuousQuantity.c:8
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, CAContinuousQuantity::m_SpentQuantity, CAContinuousQuantity::m_SpentUnits, m_TimeToComplete и Math::Min().

Поля

◆ m_PlantThirstyness

float m_PlantThirstyness
protected

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

◆ m_TimeToComplete

float m_TimeToComplete
protected

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


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