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

Protected Member Functions

void CASingleUseQuantity (float quantity_used_per_action)
 
override void Setup (ActionData action_data)
 
override int Execute (ActionData action_data)
 
void CalcAndSetQuantity (ActionData action_data)
 

Protected Attributes

float m_QuantityUsedPerAction
 
float m_ItemQuantity
 
ref Param1< floatm_SpentUnits
 

Detailed Description

Definition at line 1 of file CASingleUseQuantity.c.

Constructor & Destructor Documentation

◆ CASingleUseQuantity()

void CASingleUseQuantity::CASingleUseQuantity ( float quantity_used_per_action)
inlineprotected

Member Function Documentation

◆ CalcAndSetQuantity()

void CASingleUseQuantity::CalcAndSetQuantity ( ActionData action_data)
inlineprotected

Definition at line 33 of file CASingleUseQuantity.c.

34 {
35 if (GetGame().IsServer())
36 {
37 if (m_SpentUnits)
38 {
41 }
42
43 action_data.m_MainItem.AddQuantity(- m_QuantityUsedPerAction, false, false);
44 }
45 }
void SetACData(Param units)
Definition CABase.c:38
ref Param1< float > m_SpentUnits
proto native CGame GetGame()

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

◆ Execute()

override int CASingleUseQuantity::Execute ( ActionData action_data)
inlineprotected

Definition at line 21 of file CASingleUseQuantity.c.

22 {
23 if (!action_data.m_Player)
24 return UA_ERROR;
25
26
28 return UA_FINISHED;
29 }
void CalcAndSetQuantity()
const int UA_FINISHED
Definition constants.c:436
const int UA_ERROR
Definition constants.c:455

References CalcAndSetQuantity(), UA_ERROR, and UA_FINISHED.

◆ Setup()

override void CASingleUseQuantity::Setup ( ActionData action_data)
inlineprotected

Definition at line 12 of file CASingleUseQuantity.c.

13 {
14 if (!m_SpentUnits)
16 else
17 m_SpentUnits.param1 = 0;
18 m_ItemQuantity = action_data.m_MainItem.GetQuantity();
19 }

References m_ItemQuantity, and m_SpentUnits.

Member Data Documentation

◆ m_ItemQuantity

float CASingleUseQuantity::m_ItemQuantity
protected

Definition at line 4 of file CASingleUseQuantity.c.

Referenced by Setup().

◆ m_QuantityUsedPerAction

float CASingleUseQuantity::m_QuantityUsedPerAction
protected

◆ m_SpentUnits

ref Param1<float> CASingleUseQuantity::m_SpentUnits
protected

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