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

Protected Member Functions

void CAContinuousTime (float time_to_complete_action)
 
override void Setup (ActionData action_data)
 
override int Execute (ActionData action_data)
 
override int Cancel (ActionData action_data)
 
override float GetProgress ()
 

Protected Attributes

float m_LocalTimeElpased
 
float m_TimeElpased
 
float m_AdjustedTimeToComplete
 
float m_DefaultTimeToComplete
 
ref Param1< floatm_SpentUnits
 

Detailed Description

Definition at line 1 of file CAContinuousTime.c.

Constructor & Destructor Documentation

◆ CAContinuousTime()

void CAContinuousTime::CAContinuousTime ( float time_to_complete_action)
inlineprotected

Definition at line 9 of file CAContinuousTime.c.

References m_DefaultTimeToComplete.

Member Function Documentation

◆ Cancel()

override int CAContinuousTime::Cancel ( ActionData action_data)
inlineprotected

Definition at line 50 of file CAContinuousTime.c.

51 {
52 if (m_SpentUnits)
53 {
56 }
57 if (m_DefaultTimeToComplete < 0) //for infinite actions
58 return UA_FINISHED;
59
60 return UA_CANCEL;
61 }
void SetACData(Param units)
Definition CABase.c:38
ref Param1< float > m_SpentUnits
const int UA_FINISHED
Definition constants.c:436
const int UA_CANCEL
Definition constants.c:437

References m_DefaultTimeToComplete, m_SpentUnits, m_TimeElpased, CABase::SetACData(), UA_CANCEL, and UA_FINISHED.

◆ Execute()

override int CAContinuousTime::Execute ( ActionData action_data)
inlineprotected

Definition at line 25 of file CAContinuousTime.c.

26 {
27 if (m_DefaultTimeToComplete < 0) //for infinite actions
28 return UA_PROCESSING;
29
30 if (!action_data.m_Player)
31 return UA_ERROR;
32
34 {
35 m_TimeElpased += action_data.m_Player.GetDeltaT();
36 return UA_PROCESSING;
37 }
38 else
39 {
40 if (m_SpentUnits)
41 {
44 }
46 return UA_FINISHED;
47 }
48 }
void OnCompletePogress(ActionData action_data)
const int UA_ERROR
Definition constants.c:455
const int UA_PROCESSING
Definition constants.c:434

References m_AdjustedTimeToComplete, m_DefaultTimeToComplete, m_SpentUnits, m_TimeElpased, CAContinuousBase::OnCompletePogress(), CABase::SetACData(), UA_ERROR, UA_FINISHED, and UA_PROCESSING.

◆ GetProgress()

override float CAContinuousTime::GetProgress ( )
inlineprotected

Definition at line 63 of file CAContinuousTime.c.

64 {
66 {
67 //progress = m_TimeElpased/m_AdjustedTimeToComplete;
69 }
70 else
71 Print("USER ACTION COMPONENT CONTINUOUS TIME - WRONG TIME TO COMPLETE CALCULATION - Incorrect data for progress bar!");
72 return 1;
73 }
proto void Print(void var)
Prints content of variable to console/log.

References m_AdjustedTimeToComplete, m_TimeElpased, and Print().

◆ Setup()

override void CAContinuousTime::Setup ( ActionData action_data)
inlineprotected

Definition at line 14 of file CAContinuousTime.c.

15 {
16 m_TimeElpased = 0;
17 if (!m_SpentUnits)
19 else
20 m_SpentUnits.param1 = 0;
21
22 m_AdjustedTimeToComplete = action_data.m_Player.GetSoftSkillsManager().SubtractSpecialtyBonus(m_DefaultTimeToComplete, m_Action.GetSpecialtyWeight(), true);
23 }
ActionBase m_Action
Definition CABase.c:3

References CABase::m_Action, m_AdjustedTimeToComplete, m_DefaultTimeToComplete, m_SpentUnits, and m_TimeElpased.

Member Data Documentation

◆ m_AdjustedTimeToComplete

float CAContinuousTime::m_AdjustedTimeToComplete
protected

◆ m_DefaultTimeToComplete

float CAContinuousTime::m_DefaultTimeToComplete
protected

Definition at line 6 of file CAContinuousTime.c.

Referenced by CAContinuousTime(), Cancel(), Execute(), and Setup().

◆ m_LocalTimeElpased

float CAContinuousTime::m_LocalTimeElpased
protected

Definition at line 3 of file CAContinuousTime.c.

◆ m_SpentUnits

ref Param1<float> CAContinuousTime::m_SpentUnits
protected

◆ m_TimeElpased

float CAContinuousTime::m_TimeElpased
protected

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