Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_BuildingDestructionStruct.c
Go to the documentation of this file.
1 //------------------------------------------------------------------------------------------------
4 {
5  protected ref array<int> m_aDestroyedBuildings = {};
6 
7  //------------------------------------------------------------------------------------------------
8  override void Log()
9  {
10  Print("--- SCR_BuildingDestructionStruct ------------------------");
11  for (int i = 0, count = m_aDestroyedBuildings.Count(); i < count; i++)
12  {
13  Print("Destroyed building ID: " + m_aDestroyedBuildings[i]);
14  }
15  Print("---------------------------------------------");
16  }
17 
18  //------------------------------------------------------------------------------------------------
19  override bool Serialize()
20  {
21  m_aDestroyedBuildings = {};
22 
23  array<SCR_DestructibleBuildingComponent> destroyedBuildings = {};
24  int count = GetGame().GetBuildingDestructionManager().GetDestroyedBuildings(destroyedBuildings);
25 
26  for (int i = 0; i < count; i++)
27  {
28  m_aDestroyedBuildings.Insert(destroyedBuildings[i].GetBuildingId());
29  }
30 
31  return true;
32  }
33 
34  //------------------------------------------------------------------------------------------------
35  override bool Deserialize()
36  {
37  for (int i = 0, count = m_aDestroyedBuildings.Count(); i < count; i++)
38  {
39  SCR_DestructibleBuildingComponent destructibleBuilding = SCR_BuildingDestructionManagerComponent.GetDestructibleBuilding(m_aDestroyedBuildings[i]);
40  destructibleBuilding.GoToDestroyedStateLoad();
41  }
42 
43  return true;
44  }
45 
46  //------------------------------------------------------------------------------------------------
48  {
49  RegV("m_aDestroyedBuildings");
50  }
51 }
SCR_BuildingDestructionStruct
Definition: SCR_BuildingDestructionStruct.c:3
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
SCR_BuildingDestructionManagerComponent
Definition: SCR_BuildingDestructionManagerComponent.c:60
SCR_JsonApiStruct
Definition: SCR_JsonApiStruct.c:5
BaseContainerProps
SCR_AIGoalReaction_Follow BaseContainerProps
Handles insects that are supposed to be spawned around selected prefabs defined in prefab names array...
Definition: SCR_AIGoalReaction.c:468