Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
building.c
Go to the documentation of this file.
1class House : BuildingBase
2{
3 void House()
4 {
5 }
6}
7
8class BuildingBase : Building
9{
13
15 {
16 m_ActionsInitialize = false;
17 }
18
20 {
22 if (!m_InputActionMap)
23 {
25 m_InputActionMap = iam;
26 SetActions();
27 m_BuildingTypeActionsMap.Insert(this.Type(), m_InputActionMap);
28 }
29 }
30
31 override void GetActions(typename action_input_type, out array<ActionBase_Basic> actions)
32 {
34 {
37 }
38
39 actions = m_InputActionMap.Get(action_input_type);
40 }
41
43 {
44 //AddAction();
45 }
46
47 void AddAction(typename actionName)
48 {
49 ActionBase action = ActionManagerBase.GetAction(actionName);
50
51 if (!action)
52 {
53 Debug.LogError("Action " + actionName + " dosn't exist!");
54 return;
55 }
56
57 typename ai = action.GetInputType();
58 if (!ai)
59 {
60 m_ActionsInitialize = false;
61 return;
62 }
63 ref array<ActionBase_Basic> action_array = m_InputActionMap.Get( ai );
64
65 if (!action_array)
66 {
67 action_array = new array<ActionBase_Basic>;
68 m_InputActionMap.Insert(ai, action_array);
69 }
70
71 if ( LogManager.IsActionLogEnable() )
72 {
73 Debug.ActionLog(action.ToString() + " -> " + ai, this.ToString() , "n/a", "Add action" );
74 }
75 action_array.Insert(action);
76 }
77
78 void RemoveAction(typename actionName)
79 {
80 PlayerBase player = PlayerBase.Cast(GetGame().GetPlayer());
81 ActionBase action = player.GetActionManager().GetAction(actionName);
82 typename ai = action.GetInputType();
83 ref array<ActionBase_Basic> action_array = m_InputActionMap.Get( ai );
84
85 if (action_array)
86 {
87 action_array.RemoveItem(action);
88 }
89 }
90};
91
House m_BuildingTypeActionsMap
void BuildingBase()
Definition building.c:14
House BuildingSuper
Definition building.c:92
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
bool m_ActionsInitialize
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
void SetActions()
void InitializeActions()
Definition debug.c:2
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto native CGame GetGame()
string Type
PlayerBase GetPlayer()