Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_TutorialGamemodeComponentSerializer.c
Go to the documentation of this file.
2{
3 //------------------------------------------------------------------------------------------------
4 override static typename GetTargetType()
5 {
6 return SCR_TutorialGamemodeComponent;
7 }
8
9 //------------------------------------------------------------------------------------------------
10 override protected ESerializeResult Serialize(notnull IEntity owner, notnull GenericComponent component, notnull SaveContext context)
11 {
12 const SCR_TutorialGamemodeComponent tutorial = SCR_TutorialGamemodeComponent.Cast(component);
13
14 const SCR_ETutorialCourses courses = tutorial.GetFinishedCourses();
15 const int freeRoamActivations = tutorial.GetFreeRoamActivations();
16
17 if (courses == 0 && freeRoamActivations == 0)
18 return ESerializeResult.DEFAULT;
19
20 context.WriteValue("version", 1);
21 context.Write(courses);
22 context.Write(freeRoamActivations);
23 return ESerializeResult.OK;
24 }
25
26 //------------------------------------------------------------------------------------------------
27 override protected bool Deserialize(notnull IEntity owner, notnull GenericComponent component, notnull LoadContext context)
28 {
29 auto tutorial = SCR_TutorialGamemodeComponent.Cast(component);
30
31 int version;
32 context.Read(version);
33
35 context.Read(courses);
36
37 int freeRoamActivations;
38 context.Read(freeRoamActivations);
39
40 tutorial.SetFreeRoamActivation(freeRoamActivations);
41 tutorial.LoadProgress(courses);
42 return true;
43 }
44}
class SCR_PersistentThreatSector GetTargetType()
SCR_ETutorialCourses
bool Deserialize(notnull IEntity owner, notnull GenericComponent component, notnull LoadContext context)
ESerializeResult Serialize(notnull IEntity owner, notnull GenericComponent component, notnull SaveContext context)
ESerializeResult