Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
actionvariantsmanager.c
Go to the documentation of this file.
2 {
3  protected ref array<ref ActionBase> m_VariantActions;
4  protected typename m_type;
5  protected ref ScriptInvoker e_OnUpdate;
6 
7  void ActionVariantManager( typename type )
8  {
9  m_type = type;
10  m_VariantActions = new array<ref ActionBase>;
11  e_OnUpdate = new ScriptInvoker();
12  }
13 
14  ScriptInvoker GetOnUpdateInvoker()
15  {
16  return e_OnUpdate;
17  }
18 
19  void Clear()
20  {
21  m_VariantActions.Clear();
22  }
23 
24  void SetActionVariantCount( int count )
25  {
26  if ( count < m_VariantActions.Count() )
27  {
28  m_VariantActions.Clear();
29  }
30 
31  for (int i = m_VariantActions.Count(); i < count; i++ )
32  {
33  ActionBase action = ActionManagerBase.GetActionVariant( m_type );
34  action.SetVariantID(i);
35  m_VariantActions.Insert(action);
36  }
37 
38  }
39 
40  int GetActions( out array<ref ActionBase> variants_action)
41  {
42  variants_action = m_VariantActions;
43  return m_VariantActions.Count();
44  }
45 
46  int GetActionsCount()
47  {
48  return m_VariantActions.Count();
49  }
50 
51  void UpdateVariants( Object item, Object target, int componet_index )
52  {
53  e_OnUpdate.Invoke( item, target, componet_index );
54  }
55 }
ActionVariantManager
Definition: actionvariantsmanager.c:1
ActionManagerBase
void ActionManagerBase(PlayerBase player)
Definition: actionmanagerbase.c:62
Object
Definition: objecttyped.c:1
array< ref ActionBase >
ActionBase
void ActionBase()
Definition: actionbase.c:73
ScriptInvoker
ScriptInvoker Class provide list of callbacks usage:
Definition: tools.c:115