Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_NightModeGameModeComponentSerializer.c
Go to the documentation of this file.
2{
3 //------------------------------------------------------------------------------------------------
4 override static typename GetTargetType()
5 {
6 return SCR_NightModeGameModeComponent;
7 }
8
9 //------------------------------------------------------------------------------------------------
10 override protected ESerializeResult Serialize(notnull IEntity owner, notnull GenericComponent component, notnull SaveContext context)
11 {
12 const SCR_NightModeGameModeComponent nightMode = SCR_NightModeGameModeComponent.Cast(component);
13
14 if (!nightMode.IsGlobalNightModeEnabled())
15 return ESerializeResult.DEFAULT;
16
17 context.WriteValue("version", 1);
18 context.WriteValue("globalNightMode", true);
19 return ESerializeResult.OK;
20 }
21
22 //------------------------------------------------------------------------------------------------
23 override protected bool Deserialize(notnull IEntity owner, notnull GenericComponent component, notnull LoadContext context)
24 {
25 SCR_NightModeGameModeComponent nightMode = SCR_NightModeGameModeComponent.Cast(component);
26
27 int version;
28 context.Read(version);
29
30 bool globalNightMode;
31 if (context.Read(globalNightMode))
32 nightMode.EnableGlobalNightMode(true);
33
34 return true;
35 }
36}
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