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

Private Member Functions

override void Setup (ActionData action_data)
 
override int Execute (ActionData action_data)
 
override float GetProgress ()
 
- Private Member Functions inherited from CAContinuousTime
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 ()
 

Additional Inherited Members

- Private Attributes inherited from CAContinuousTime
float m_LocalTimeElpased
 
float m_TimeElpased
 
float m_AdjustedTimeToComplete
 
float m_DefaultTimeToComplete
 
ref Param1< floatm_SpentUnits
 

Detailed Description

Definition at line 1 of file CAContinuousCraft.c.

Member Function Documentation

◆ Execute()

override int CAContinuousCraft::Execute ( ActionData action_data)
inlineprivate

Definition at line 28 of file CAContinuousCraft.c.

29 {
30 if (!action_data.m_Player)
31 return UA_ERROR;
32
34 m_TimeElpased += action_data.m_Player.GetDeltaT();
35 else
36 {
37 if (m_SpentUnits)
38 {
41 }
43 return UA_FINISHED;
44 }
45 return UA_PROCESSING;
46 }
void SetACData(Param units)
Definition CABase.c:38
void OnCompletePogress(ActionData action_data)
ref Param1< float > m_SpentUnits
const int UA_FINISHED
Definition constants.c:436
const int UA_ERROR
Definition constants.c:455
const int UA_PROCESSING
Definition constants.c:434

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

◆ GetProgress()

override float CAContinuousCraft::GetProgress ( )
inlineprivate

Definition at line 48 of file CAContinuousCraft.c.

49 {
51 {
52 //float progress = m_TimeElpased/m_AdjustedTimeToComplete;
54 }
55 return 1;
56 }

References CAContinuousTime::m_AdjustedTimeToComplete, and CAContinuousTime::m_TimeElpased.

◆ Setup()

override void CAContinuousCraft::Setup ( ActionData action_data)
inlineprivate

Definition at line 3 of file CAContinuousCraft.c.

4 {
6 m_AdjustedTimeToComplete = 1000; //indication of arror if somting will be craft 1000 sec
7 if (!m_SpentUnits)
9 else
10 m_SpentUnits.param1 = 0;
11
13
14 PluginRecipesManager module_recipes_manager;
15 Class.CastTo(module_recipes_manager, GetPlugin(PluginRecipesManager));
17 {
18 m_AdjustedTimeToComplete = module_recipes_manager.GetRecipeLengthInSecs(action_data_wc.m_RecipeID);
19 if (module_recipes_manager.GetIsInstaRecipe(action_data_wc.m_RecipeID) || module_recipes_manager.IsEnableDebugCrafting())
21 float specialty_weight = module_recipes_manager.GetRecipeSpecialty(action_data_wc.m_RecipeID);
22 m_AdjustedTimeToComplete = action_data.m_Player.GetSoftSkillsManager().AdjustCraftingTime(m_AdjustedTimeToComplete, specialty_weight);
23
24 //PrintString("ttc:" + m_AdjustedTimeToComplete.ToString());
25 }
26 }
PluginBase GetPlugin(typename plugin_type)
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.

References Class::CastTo(), GetPlugin(), CAContinuousTime::m_AdjustedTimeToComplete, CAContinuousTime::m_SpentUnits, and CAContinuousTime::m_TimeElpased.


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