Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
ppematclassparametercommanddata.c
Go to the documentation of this file.
2 
4 {
5  //default layer constants, complex data like colors PPEMatClassParameterColor are handled separately
6  const int LAYER_INFO_VALUE = 0;
7  const int LAYER_INFO_OPERATOR = 1;
8 
9  ref array<int> m_CommandLayersArray; //for tracking active priorities and sorting them //TODO - could have been 'set'..
10  protected int m_UpdatedCount;
11  protected int m_MaterialIndex; //just a helper
12  protected int m_ParameterIndex;
13  protected ref ActiveParameterRequestsMap m_RequestMap;//<request_ID, parameter data>
14  protected PPEClassBase m_Parent;
15  protected ref Param m_Defaults; // Careful, formating is such, that param1 is ALWAYS string, containing parameter name. Actual values follow.
16  protected ref Param m_CurrentValues; // Careful, only actual values, WITHOUT string
17 
18  protected ref map<int,ref array<int>> m_Dependencies;
19 
20  void PPEMatClassParameterCommandData(int mat_idx, int parameter_idx, PPEClassBase parent)
21  {
22  m_MaterialIndex = mat_idx;
23  m_ParameterIndex = parameter_idx;
24  m_Parent = parent;
25 
26  m_CommandLayersArray = new array<int>;
27  m_UpdatedCount = 0;
28  m_RequestMap = new ActiveParameterRequestsMap;
29  }
30 
31  int GetParameterVarType()
32  {
33  return -1;
34  }
35 
36  void SetMaterialIndex(int value)
37  {
38  m_MaterialIndex = value;
39  }
40 
41  void SetParameterIndex(int value)
42  {
43  m_ParameterIndex = value;
44  }
45 
46  void SetParent(PPEClassBase parent)
47  {
48  m_Parent = parent;
49  }
50 
51  void InsertRequestData(PPERequestParamDataBase request_data)
52  {
53  m_RequestMap.Set(request_data.GetRequesterIDX(),request_data);//<request_ID, data>
54  }
55 
56  void Update(float timeslice, out Param p_total, out bool setting_defaults, int order)
57  {
58  //insert dependencies to another update round
59  if ( m_Dependencies && m_Dependencies.Count() > 0 && order < PPEConstants.DEPENDENCY_ORDER_HIGHEST )
60  {
61  int key_mat = -1;
62  int element_par = -1;
63  for (int i = 0; i < m_Dependencies.Count(); i++)
64  {
65  key_mat = m_Dependencies.GetKey(i);
66  for (int j = 0; j < m_Dependencies.GetElement(i).Count(); j++)
67  {
68  element_par = m_Dependencies.GetElement(i).Get(j);
69  PPEManagerStatic.GetPPEManager().SetMaterialParamUpdating(key_mat,element_par,order + 1); // TODO - revise, currently only does one more update
70  }
71  }
72  }
73  }
74 
76  void ModifyResultValues(inout Param result_values)
77  {
78  }
79 
81  void AddPriorityInfo(int priority)
82  {
83  if ( m_CommandLayersArray.Find(priority) == -1 )
84  {
85  m_CommandLayersArray.Insert(priority);
86  m_CommandLayersArray.Sort();
87  }
88  else
89  {
90  //DbgPrnt("PPEDebug | PPEMatClassParameterCommandData - AddPriorityInfo | Already exists, values have been overwritten!");
91  }
92  }
93 
95  void RemovePriorityInfo(int priority)
96  {
97  }
98 
100  void RegisterDefaults(Param p)
101  {
102  m_Defaults = p;
103  InitDefaults();
104  InitCuttent();
105  }
106 
107  protected void InitDefaults() {};
108 
109  protected void InitCuttent() {};
110 
111  protected void SetParameterValueDefault(inout Param p_total)
112  {
113  }
114 
116  Param GetDefaultValues()
117  {
118  return m_Defaults;
119  }
120 
122  Param GetCurrentValues()
123  {
124  return m_CurrentValues;
125  }
126 
127  void DbgPrnt(string text)
128  {
129  //Debug.Log(""+text);
130  }
131 }
PPEClassBase
Created once, on manager init. Script-side representation of C++ material class, separate handling.
Definition: ppematclassesbase.c:2
Param
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
Definition: param.c:11
PPEMatClassParameterCommandData
Definition: ppematclassparameterbool.c:1
m_Parent
protected Widget m_Parent
Definition: sizetochild.c:92
PPEManagerStatic
Static component of PPE manager, used to hold the instance.
Definition: ppemanager.c:2
map
map
Definition: controlsxboxnew.c:3
PPERequestParamDataBase
Data for one material parameter, requester side.
Definition: pperequestdata.c:2
array
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
Definition: isboxcollidinggeometryproxyclasses.c:27
ActiveParameterRequestsMap
map< int, ref PPERequestParamDataBase > ActiveParameterRequestsMap
Definition: ppematclassparametercommanddata.c:1
Count
@ Count
Definition: randomgeneratorsyncmanager.c:7