Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
building.c
Go to the documentation of this file.
1 class House : BuildingBase
2 {
3  void House()
4  {
5  }
6 }
7 
8 class BuildingBase : Building
9 {
13 
14  void BuildingBase()
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  {
35  m_ActionsInitialize = true;
37  }
38 
39  actions = m_InputActionMap.Get(action_input_type);
40  }
41 
42  void SetActions()
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 
92 typedef House BuildingSuper;
BuildingBase
void BuildingBase()
Definition: building.c:14
GetGame
proto native CGame GetGame()
m_BuildingTypeActionsMap
House m_BuildingTypeActionsMap
SetActions
void SetActions()
Definition: building.c:42
LogManager
Definition: debug.c:734
InitializeActions
void InitializeActions()
Definition: building.c:19
ActionManagerBase
void ActionManagerBase(PlayerBase player)
Definition: actionmanagerbase.c:62
PlayerBase
Definition: playerbaseclient.c:1
map
map
Definition: controlsxboxnew.c:3
m_ActionsInitialize
bool m_ActionsInitialize
Definition: building.c:12
RemoveAction
void RemoveAction(typename actionName)
Definition: building.c:78
House
Definition: crashbase.c:1
array
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
Definition: isboxcollidinggeometryproxyclasses.c:27
ActionBase
void ActionBase()
Definition: actionbase.c:73
GetPlayer
protected void GetPlayer()
Definition: crosshairselector.c:127
TInputActionMap
map< typename, ref array< ActionBase_Basic > > TInputActionMap
Definition: actionmanagerclient.c:1
Debug
Definition: debug.c:13
Type
string Type
Definition: jsondatacontaminatedarea.c:11
GetActions
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
Definition: building.c:31
BuildingSuper
House BuildingSuper
Definition: building.c:90
m_InputActionMap
TInputActionMap m_InputActionMap
Definition: building.c:11
AddAction
void AddAction(typename actionName)
Definition: building.c:47