Called manually after spawning from typename.
11 {
12 super.InitPartsTypeDataHolder(eType, cfgPath);
13
17
18
19 for (
int i = 0; i <
g_Game.ConfigGetChildrenCount(cfgPath); ++i)
20 {
21 string mainPartName;
22 g_Game.ConfigGetChildName(cfgPath, i, mainPartName);
23 string mainPartPath = cfgPath + " " + mainPartName;
24
25
26 for (
int j = 0; j <
g_Game.ConfigGetChildrenCount(mainPartPath); ++j)
27 {
28 string partName = "";
29 g_Game.ConfigGetChildName(mainPartPath, j, partName);
30 string partPath = mainPartPath + " " + partName;
31 ConstructionPartTypeData typeDataObject;
32
33
34 string customTypeStr;
35 string customPartPath = partPath + " custom_part_type";
36 if (
g_Game.ConfigIsExisting(customPartPath) &&
g_Game.ConfigGetText(customPartPath, customTypeStr))
37 {
38 Class.CastTo(typeDataObject, (customTypeStr +
"TypeData").ToType().
Spawn());
39 }
40
41
42 if (!typeDataObject)
43 typeDataObject = new ConstructionPartTypeData();
44 else
46
47 PartTypeInitData initData = new PartTypeInitData();
48 initData.m_PartPath = partPath;
49 initData.m_PartName = partName;
50 initData.m_MainPartName = mainPartName;
52
53
54 if (
g_Game.ConfigIsExisting(cfgPath +
" can_decay_general"))
56
59
61 }
62 }
63 }
void Spawn()
spawn damage trigger
void InitAttachmentGUIPartStructure(EntityAIType eType)
void InitAttachmentGUIPartLinks(EntityAIType eType, ConstructionPartTypeData typeDataObject)
ref array< ConstructionPartTypeData > m_ConstructionPartTypes
ref map< string, ref ConstructionPartTypeData > m_ConstructionPartTypeMap
void InitPartTypeData(PartTypeInitData initData)
void SetCustomInstanceType(string name)
void SetCanDecayConfig(bool can)