Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
constructionpart.c
Go to the documentation of this file.
2{
3 string m_Name; //localized text name that is displayed ingame
4 int m_Id; //a number used for synchronization and persistence purposes, must be unique and withing sync limit (total number of bits in all sync/persistence variables)
5 string m_PartName; //config class name
6 string m_MainPartName; //main (parent) config class name
7 bool m_IsBuilt; //defines part build state
8 bool m_IsBase; //defines if this part is the foundation of the whole construction
9 bool m_IsGate; //defines part gate state
10 ref array<string> m_RequiredParts; //list of parts required by this part
11
12 void ConstructionPart( string name, string part_name, string main_part_name, int id, bool is_built, bool is_base, bool is_gate, array<string> required_parts )
13 {
14 m_Name = name;
15 m_PartName = part_name;
16 m_MainPartName = main_part_name;
17 m_Id = id;
18 m_IsBuilt = is_built;
19 m_IsBase = is_base;
20 m_IsGate = is_gate;
21 m_RequiredParts = required_parts;
22 }
23
24 string GetName()
25 {
26 string ret = Widget.TranslateString(m_Name);
27 return ret;
28 }
29
30 string GetPartName()
31 {
32 return m_PartName;
33 }
34
35 string GetMainPartName()
36 {
37 return m_MainPartName;
38 }
39
40 int GetId()
41 {
42 return m_Id;
43 }
44
45 bool IsBuilt()
46 {
47 return m_IsBuilt;
48 }
49
50 void SetBuiltState( bool is_built )
51 {
52 if (LogManager.IsBaseBuildingLogEnable()) bsbDebugPrint("[bsb] SetBuildState=" + is_built + " part=" + m_PartName);
53 m_IsBuilt = is_built;
54 }
55
56 void SetRequestBuiltState( bool req_built )
57 {
58 if (LogManager.IsBaseBuildingLogEnable()) bsbDebugPrint("[bsb] SetRequestBuiltState=" + req_built + " part=" + m_PartName);
59 if (GetGame().IsMultiplayer())
60 SetBuiltState(req_built);
61 else
62 ; // skip set to true in single player - will be synced later
63 }
64
65 bool IsBase()
66 {
67 return m_IsBase;
68 }
69
70 bool IsGate()
71 {
72 return m_IsGate;
73 }
74
75 array<string> GetRequiredParts()
76 {
77 return m_RequiredParts;
78 }
79}
class BaseBuildingBase extends ItemBase bsbDebugPrint(string s)
class ServerBrowserHelperFunctions m_Id
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
string m_PartName
proto native CGame GetGame()
class SyncedValue m_Name