DayZ 1.24
Loading...
Searching...
No Matches
CAContinuousQuantity Class Reference
Inheritance diagram for CAContinuousQuantity:
[legend]
Collaboration diagram for CAContinuousQuantity:
[legend]

Protected Member Functions

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)
 

Protected Attributes

float m_ItemQuantity
 
float m_SpentQuantity
 
float m_ItemMaxQuantity
 
float m_QuantityUsedPerSecond
 
float m_AdjustedQuantityUsedPerSecond
 
ref Param1< floatm_SpentUnits
 

Detailed Description

Definition at line 1 of file CAContinuousQuantity.c.

Constructor & Destructor Documentation

◆ CAContinuousQuantity()

void CAContinuousQuantity::CAContinuousQuantity ( float quantity_used_per_second)
inlineprotected

Member Function Documentation

◆ CalcAndSetQuantity()

void CAContinuousQuantity::CalcAndSetQuantity ( ActionData action_data)
inlineprotected

Definition at line 69 of file CAContinuousQuantity.c.

70 {
71 if (GetGame().IsServer())
72 {
73 if (m_SpentUnits)
74 {
77 }
78
79 if (action_data.m_MainItem)
80 action_data.m_MainItem.AddQuantity(- m_SpentQuantity, false, false);
81 }
82 }
void SetACData(Param units)
Definition CABase.c:38
ref Param1< float > m_SpentUnits
proto native CGame GetGame()

References GetGame(), m_SpentQuantity, m_SpentUnits, and CABase::SetACData().

◆ Cancel()

override int CAContinuousQuantity::Cancel ( ActionData action_data)
inlineprotected

Definition at line 51 of file CAContinuousQuantity.c.

52 {
53 if (!action_data.m_Player)
54 return UA_ERROR;
55
57 return UA_INTERRUPT;
58 }
void CalcAndSetQuantity()
const int UA_ERROR
Definition constants.c:455
const int UA_INTERRUPT
Definition constants.c:438

References CalcAndSetQuantity(), UA_ERROR, and UA_INTERRUPT.

◆ Execute()

override int CAContinuousQuantity::Execute ( ActionData action_data)
inlineprotected

Definition at line 27 of file CAContinuousQuantity.c.

28 {
29 if (!action_data.m_Player)
30 return UA_ERROR;
31
32 if (m_ItemQuantity <= 0)
33 return UA_FINISHED;
34 else
35 {
37 {
38 m_AdjustedQuantityUsedPerSecond = action_data.m_Player.GetSoftSkillsManager().AddSpecialtyBonus(m_QuantityUsedPerSecond, m_Action.GetSpecialtyWeight(), true);
40 return UA_PROCESSING;
41 }
42 else
43 {
46 return UA_FINISHED;
47 }
48 }
49 }
ActionBase m_Action
Definition CABase.c:3
void OnCompletePogress(ActionData action_data)
const int UA_FINISHED
Definition constants.c:436
const int UA_PROCESSING
Definition constants.c:434

References CalcAndSetQuantity(), CABase::m_Action, m_AdjustedQuantityUsedPerSecond, m_ItemQuantity, m_QuantityUsedPerSecond, m_SpentQuantity, CAContinuousBase::OnCompletePogress(), UA_ERROR, UA_FINISHED, and UA_PROCESSING.

◆ GetProgress()

override float CAContinuousQuantity::GetProgress ( )
inlineprotected

Definition at line 60 of file CAContinuousQuantity.c.

61 {
62 //float progress = m_SpentQuantity/m_ItemQuantity;
64 }

References m_ItemQuantity, and m_SpentQuantity.

◆ Setup()

override void CAContinuousQuantity::Setup ( ActionData action_data)
inlineprotected

Definition at line 15 of file CAContinuousQuantity.c.

16 {
18 if (!m_SpentUnits)
20 else
21 m_SpentUnits.param1 = 0;
22 m_ItemMaxQuantity = action_data.m_MainItem.GetQuantityMax();
23 m_ItemQuantity = action_data.m_MainItem.GetQuantity();
24 }

References m_ItemMaxQuantity, m_ItemQuantity, m_SpentQuantity, and m_SpentUnits.

Member Data Documentation

◆ m_AdjustedQuantityUsedPerSecond

float CAContinuousQuantity::m_AdjustedQuantityUsedPerSecond
protected

Definition at line 7 of file CAContinuousQuantity.c.

Referenced by Execute(), and CAContinuousWaterPlant::Execute().

◆ m_ItemMaxQuantity

float CAContinuousQuantity::m_ItemMaxQuantity
protected

Definition at line 5 of file CAContinuousQuantity.c.

Referenced by CAContinuousWaterSlot::Execute(), and Setup().

◆ m_ItemQuantity

◆ m_QuantityUsedPerSecond

◆ m_SpentQuantity

◆ m_SpentUnits


The documentation for this class was generated from the following file: