Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_CampaignMobileAssemblyComponentSerializer.c
Go to the documentation of this file.
2{
3 //------------------------------------------------------------------------------------------------
4 override static typename GetTargetType()
5 {
6 return SCR_CampaignMobileAssemblyComponent;
7 }
8
9 //------------------------------------------------------------------------------------------------
10 override protected ESerializeResult Serialize(notnull IEntity owner, notnull GenericComponent component, notnull SaveContext context)
11 {
12 const SCR_CampaignMobileAssemblyComponent mobileAssembly = SCR_CampaignMobileAssemblyComponent.Cast(component);
13 if (!mobileAssembly.IsDeployed())
14 return ESerializeResult.DEFAULT;
15
16 context.WriteValue("version", 1);
17 context.WriteValue("deployed", true);
18 return ESerializeResult.OK;
19 }
20
21 //------------------------------------------------------------------------------------------------
22 override protected bool Deserialize(notnull IEntity owner, notnull GenericComponent component, notnull LoadContext context)
23 {
24 auto mobileAssembly = SCR_CampaignMobileAssemblyComponent.Cast(component);
25
26 int version;
27 context.Read(version);
28
29 bool deployed;
30 context.Read(deployed);
31 if (deployed)
32 {
33 mobileAssembly.UpdateRadioCoverage();
34 mobileAssembly.Deploy(SCR_EMobileAssemblyStatus.DEPLOYED, silent: true);
35 }
36
37 return true;
38 }
39}
class SCR_PersistentThreatSector GetTargetType()
bool Deserialize(notnull IEntity owner, notnull GenericComponent component, notnull LoadContext context)
ESerializeResult Serialize(notnull IEntity owner, notnull GenericComponent component, notnull SaveContext context)
ESerializeResult