DayZ 1.30
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
ConstructionStatics.c
См. документацию.
2{
4 protected ref set<int> m_ConfiguredCategories;
5
6 void Init(string partPath)
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
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 }
70
71 int GetSupportProvided(int category)
72 {
73 if (!m_ValueMap || !m_ValueMap.Contains(category))
74 return 0;
75
76 return m_ValueMap.Get(category).m_ProvidedSupport;
77 }
78
79 int GetSupportRequirement(int category)
80 {
81 if (!m_ValueMap || !m_ValueMap.Contains(category))
82 return 0;
83
84 return m_ValueMap.Get(category).m_RequiredSupport;
85 }
86
91}
92
94{
98
99 void StaticsSupportCategoryValues(int category, int provides, int requires)
100 {
101 m_Category = category;
102 m_ProvidedSupport = provides;
103 m_RequiredSupport = requires;
104 }
105}
int m_ProvidedSupport
Определения ConstructionStatics.c:96
int m_RequiredSupport
Определения ConstructionStatics.c:97
void StaticsSupportCategoryValues(int category, int provides, int requires)
Определения ConstructionStatics.c:99
DayZGame g_Game
Определения DayZGame.c:4074
string path
Определения OptionSelectorMultistate.c:142
void Init(string partPath)
Определения ConstructionStatics.c:6
int GetSupportProvided(int category)
Определения ConstructionStatics.c:71
set< int > GetConfiguredSupportCategories()
Определения ConstructionStatics.c:87
ref set< int > m_ConfiguredCategories
Определения ConstructionStatics.c:4
int GetSupportRequirement(int category)
Определения ConstructionStatics.c:79
ref map< int, ref StaticsSupportCategoryValues > m_ValueMap
Определения ConstructionStatics.c:3
Определения Transport.c:70
string m_Category
folder structure eg. StaticEntities/Walls
Определения EnEntity.c:846
proto native int Hash()
Returns hash of string.