DayZ 1.24
Loading...
Searching...
No Matches
CfgParamArray.c
Go to the documentation of this file.
1class CfgParamArray extends CfgParam
2{
4
6 {
8 }
9
11 {
12 if (m_Values != NULL)
13 Clear();
14 }
15
16 void Clear()
17 {
18 m_Values.Clear();
19 }
20
22 {
23 return m_Values;
24 }
25
27 {
28 return m_Values.Get(i);
29 }
30
32 {
33 if (m_Values == NULL)
35
36 m_Values.Insert(value);
37 }
38
39 bool IsParamExist(string name, int cfg_type)
40 {
41 if (m_Values == NULL)
43
44 for (int i = 0; i < m_Values.Count(); ++i)
45 {
46 CfgParam p = m_Values.Get(i);
47
48 if (name == p.GetName())
49 return true;
50 }
51
52 return false;
53 }
54
55 bool RenameParam(string name, int cfg_type, string new_name)
56 {
57 if (m_Values == NULL)
59
60 for (int i = 0; i < m_Values.Count(); ++i)
61 {
62 CfgParam p = m_Values.Get(i);
63
64 if (name == p.GetName())
65 {
66 p.SetName(new_name);
67 return true;
68 }
69 }
70
71 return false;
72 }
73
75 {
76 if (m_Values == NULL)
78
79 for (int i = 0; i < m_Values.Count(); ++i)
80 {
81 CfgParam p = m_Values.Get(i);
82
83 if (name == p.GetName())
84 return p;
85 }
86
88 m_Values.Insert(param);
89
90 return param;
91 }
92
97
99 {
100 return true;
101 }
102
103 override int GetType()
104 {
105 return CFG_TYPE_ARRAY;
106 }
107}
const int CFG_TYPE_ARRAY
Definition CfgParam.c:5
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
ref array< string > m_Values
names parsed from m_Pairs
static CfgParam CreateParam(string name, int cfg_type)
Definition CfgParam.c:38
CfgParam GetValue(int i)
void ~CfgParamArray()
bool RenameParam(string name, int cfg_type, string new_name)
void SetParams(array< ref CfgParam > value_array)
void CfgParamArray(string param_name)
ref array< ref CfgParam > m_Values
void Clear()
void InsertValue(CfgParam value)
override int GetType()
array< ref CfgParam > GetValues()
bool IsParamExist(string name, int cfg_type)
bool IsValueArray()
CfgParam GetValueByName(string name, int cfg_type)