8 void PPEMatClassParameterInt(
int mat_idx,
int parameter_idx,
PPEClassBase parent)
15 Class.CastTo(m_Int,m_Defaults);
26 return PPEConstants.VAR_TYPE_INT;
29 override void Update(
float timeslice, out
Param p_total, out
bool setting_defaults,
int order)
31 super.Update(timeslice,p_total,setting_defaults,order);
33 int active_request_count = 0;
35 PPERequestParamDataInt req_data;
37 bool setting_value_zero =
false;
39 bool int_value_temp =
false;
44 p_total =
new Param1<int>(0);
47 if (m_RequestMap.Count() > 0)
55 m_Parent.ParamUpdateRemove(m_ParameterIndex);
59 for (
int i = 0; i < m_RequestMap.Count(); i++ )
61 req_data = PPERequestParamDataInt.Cast(m_RequestMap.GetElement(i));
65 Error(
"Debug | PPEMatClassParameterInt | req_data not found! | " +
this +
" | mat/par: " + m_MaterialIndex +
"/" + m_ParameterIndex);
69 setting_value_zero = req_data.IsSettingDefaultValues();
71 if (setting_value_zero && !req_data.GetUpdatingDataValues() && !req_data.IsDataActive())
77 if (setting_value_zero)
79 req_data.m_IntTarget =
false;
84 active_request_count++;
89 req_data.m_IntLast = req_data.m_IntCurrent;
91 if (!req_data.GetUpdatingDataValues() && req_data.IsDataActive())
93 int_value_temp = req_data.m_IntCurrent;
94 PrepareLayerInfo(req_data.GetPriorityLayer(),int_value_temp,req_data.GetInteractionMask());
99 int_value_temp = req_data.m_IntTarget;
102 req_data.SetUpdatingDataValues(
false);
103 if (setting_value_zero)
105 req_data.SetDataActive(
false);
110 int_value_temp = req_data.m_IntTarget;
111 PrepareLayerInfo(req_data.GetPriorityLayer(),int_value_temp,req_data.GetInteractionMask());
114 req_data.m_IntCurrent = int_value_temp;
117 if (active_request_count == 0)
127 bool override_active =
false;
131 if ( override_active )
134 value =
m_LayerInfo.Get(m_CommandLayersArray.Get(i)).Get(LAYER_INFO_VALUE);
135 operator =
m_LayerInfo.Get(m_CommandLayersArray.Get(i)).Get(LAYER_INFO_OPERATOR);
140 int_value_total =
Math.Min(int_value_total,value);
144 int_value_total =
Math.Max(int_value_total,value);
148 int_value_total = value;
152 int_value_total = value;
156 Error(
"PPEMatClassParameterInt | Invalid operator " +
operator +
" in mat/par: " + m_MaterialIndex +
"/" + m_ParameterIndex);
163 override_active =
true;
167 m_CommandLayersArray.Clear();
169 Param1<int>.Cast(p_total).param1 = int_value_total;
173 m_Parent.ParamUpdateRemove(m_ParameterIndex);
175 m_CurrentValues = p_total;
181 AddPriorityInfo(layer);
188 m_CurrentValues = p_total;