Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
cabase.c
Go to the documentation of this file.
1 class CABase
2 {
3  protected ActionBase m_Action;
4  protected float m_LastTick;
5  protected ref Param m_ACData;
6  protected ref Param2<float,float> m_ProgressParam;
7 
8  void Init( ActionData action_data )
9  {
10  m_ProgressParam = new Param2<float,float>(0,0);
11  m_Action = action_data.m_Action;
12  if ( !m_ACData )
13  {
14  m_ACData = new Param;
15  }
16  m_LastTick = GetGame().GetTime();
17  Setup(action_data);
18  }
19 
20  void Setup( ActionData action_data )
21  {
22  }
23 
24  int Execute( ActionData action_data )
25  {
26  return UA_ERROR;
27  }
28 
29  int Cancel( ActionData action_data )
30  {
31  return UA_CANCEL;
32  }
33 
34  int Interrupt( ActionData action_data )
35  {
36  Cancel( action_data );
37  return UA_INTERRUPT;
38  }
39 
40  void SetACData(Param units) //overload this method if you want to send more than one parameter out of the action component
41  {
42  if ( m_ACData )
43  {
44  m_ACData = units;
45  }
46  }
47 
48  Param GetACData()
49  {
50  if ( m_ACData )
51  {
52  return m_ACData;
53  }
54  return NULL;
55  }
56 
57  bool IsContinuousAction() //informs command callback whether action is looped or oneshot
58  {
59  return false;
60  }
61 
62  float GetProgress()
63  {
64  return 0;
65  }
66 };
Param2< float, float >
UA_INTERRUPT
const int UA_INTERRUPT
Definition: constants.c:438
GetGame
proto native CGame GetGame()
UA_ERROR
const int UA_ERROR
Definition: constants.c:455
Param
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
Definition: param.c:11
m_LastTick
int m_LastTick
Definition: displaystatus.c:30
CABase
Definition: cabase.c:1
UA_CANCEL
const int UA_CANCEL
Definition: constants.c:437
ActionData
Definition: actionbase.c:20
ActionBase
void ActionBase()
Definition: actionbase.c:73
m_Action
enum ActionInputType m_Action