DayZ 1.30
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ InitPartsTypeDataHolder()

override void ConstructionDataTypeHolder::InitPartsTypeDataHolder ( EntityAIType eType,
string cfgPath )
inlineprotected

Called manually after spawning from typename.

См. определение в файле ConstructionPartTypedHolder.c строка 10

11 {
12 super.InitPartsTypeDataHolder(eType, cfgPath);
13
14 m_ConstructionPartTypeMap = new map<string, ref ConstructionPartTypeData>();
15 m_ConstructionPartTypes = new array<ConstructionPartTypeData>();
17
18 //main parts
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 //parts
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 //check creation of a custom part data type first
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 //default typeDataObject creation
42 if (!typeDataObject)
43 typeDataObject = new ConstructionPartTypeData();
44 else
45 typeDataObject.SetCustomInstanceType(customTypeStr);
46
47 PartTypeInitData initData = new PartTypeInitData();
48 initData.m_PartPath = partPath;
49 initData.m_PartName = partName;
50 initData.m_MainPartName = mainPartName;
51 typeDataObject.InitPartTypeData(initData);
52
53 //general behavior for the entire construction
54 if (g_Game.ConfigIsExisting(cfgPath + " can_decay_general"))
55 typeDataObject.SetCanDecayConfig(g_Game.ConfigGetInt(cfgPath + " can_decay_general"));
56
57 m_ConstructionPartTypeMap.Insert(partName, typeDataObject);
58 m_ConstructionPartTypes.Insert(typeDataObject);
59
60 InitAttachmentGUIPartLinks(eType, typeDataObject);
61 }
62 }
63 }
void Spawn()
spawn damage trigger
Определения AreaDamageManager.c:70
DayZGame g_Game
Определения DayZGame.c:4074
void InitAttachmentGUIPartStructure(EntityAIType eType)
Определения ConstructionPartTypedHolder.c:65
void InitAttachmentGUIPartLinks(EntityAIType eType, ConstructionPartTypeData typeDataObject)
Определения ConstructionPartTypedHolder.c:82
ref array< ConstructionPartTypeData > m_ConstructionPartTypes
Определения ConstructionPartTypedHolder.c:5
ref map< string, ref ConstructionPartTypeData > m_ConstructionPartTypeMap
Определения ConstructionPartTypedHolder.c:4
void InitPartTypeData(PartTypeInitData initData)
Определения ConstructionPartTyped.c:45
void SetCustomInstanceType(string name)
Определения ConstructionPartTyped.c:419
void SetCanDecayConfig(bool can)
Определения ConstructionPartTyped.c:414

Перекрестные ссылки Class::CastTo(), g_Game, InitAttachmentGUIPartLinks(), InitAttachmentGUIPartStructure(), ConstructionPartTypeData::InitPartTypeData(), m_ConstructionPartTypeMap, m_ConstructionPartTypes, ConstructionPartTypeData::SetCanDecayConfig(), ConstructionPartTypeData::SetCustomInstanceType() и Spawn().