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

◆ Init()

void ConstructionPartStaticsSupportData::Init ( string partPath)
inlineprotected

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

7 {
8 //prevents double initialization
9 if (m_ValueMap)
10 return;
11
12 m_ConfiguredCategories = new set<int>();
13 string pathBase = partPath + " StaticsSupportData";
14 if (g_Game.ConfigIsExisting(pathBase))
15 {
16 string childName;
17 string supportCategory;
18 int supportStrength;
19 int i;
20
21 m_ValueMap = new map<int, ref StaticsSupportCategoryValues>();
22 map<int, int> requirementMap = new map<int, int>();
23 map<int, int> providerMap = new map<int, int>();
24
25 //support provider data basic parse
26 string path = pathBase + " SupportProviders";
27 int count = g_Game.ConfigGetChildrenCount(path);
28 if (count > 0)
29 {
30 for (i = 0; i < count; ++i)
31 {
32 childName = "";
33 supportCategory = "";
34 supportStrength = 0;
35
36 g_Game.ConfigGetChildName(path, i, childName);
37 g_Game.ConfigGetTextRaw(path + " " + childName + " supportCategory", supportCategory);
38 supportStrength = g_Game.ConfigGetInt(path + " " + childName + " supportStrength");
39 providerMap.Insert(supportCategory.Hash(), supportStrength);
40 m_ConfiguredCategories.Insert(supportCategory.Hash());
41 }
42 }
43
44 //support requirements data basic parse
45 path = pathBase + " SupportRequirements";
46 count = g_Game.ConfigGetChildrenCount(path);
47 if (count > 0)
48 {
49 for (i = 0; i < count; ++i)
50 {
51 childName = "";
52 supportCategory = "";
53 supportStrength = 0;
54
55 g_Game.ConfigGetChildName(path, i, childName);
56 g_Game.ConfigGetTextRaw(path + " " + childName + " supportCategory", supportCategory);
57 supportStrength = g_Game.ConfigGetInt(path + " " + childName + " supportStrength");
58 requirementMap.Insert(supportCategory.Hash(), supportStrength);
59 m_ConfiguredCategories.Insert(supportCategory.Hash());
60 }
61 }
62
63 //now insert as 'StaticsSupportCategoryValues'
64 foreach (int category : m_ConfiguredCategories)
65 {
66 m_ValueMap.Insert(category, new StaticsSupportCategoryValues(category, providerMap.Get(category), requirementMap.Get(category)));
67 }
68 }
69 }
void StaticsSupportCategoryValues(int category, int provides, int requires)
Определения ConstructionStatics.c:99
DayZGame g_Game
Определения DayZGame.c:4074
string path
Определения OptionSelectorMultistate.c:142
ref set< int > m_ConfiguredCategories
Определения ConstructionStatics.c:4
ref map< int, ref StaticsSupportCategoryValues > m_ValueMap
Определения ConstructionStatics.c:3
proto native int Hash()
Returns hash of string.

Перекрестные ссылки g_Game, string::Hash(), m_ConfiguredCategories, m_ValueMap, path и StaticsSupportCategoryValues().