Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_NotificationSenderComponentSerializer.c
Go to the documentation of this file.
2{
3 //------------------------------------------------------------------------------------------------
4 override static typename GetTargetType()
5 {
6 return SCR_NotificationSenderComponent;
7 }
8
9 //------------------------------------------------------------------------------------------------
10 override protected ESerializeResult Serialize(notnull IEntity owner, notnull GenericComponent component, notnull SaveContext context)
11 {
12 const SCR_NotificationSenderComponent notifcationSender = SCR_NotificationSenderComponent.Cast(component);
13 const BaseContainer source = notifcationSender.GetComponentSource(owner);
14
15 const EKillFeedType killFeedType = notifcationSender.GetKillFeedType();
16 EKillFeedType killFeedTypeDefault = EKillFeedType.UNKNOWN_KILLER;
17 if (source)
18 source.Get("m_iKillFeedType", killFeedTypeDefault);
19
20 const EKillFeedReceiveType receivekillFeedType = notifcationSender.GetReceiveKillFeedType();
21 EKillFeedReceiveType receivekillFeedTypeDefault = EKillFeedReceiveType.GROUP_ONLY;
22 if (source)
23 source.Get("m_iReceiveKillFeedType", receivekillFeedTypeDefault);
24
25 const SCR_EFriendlyFireKillFeedType friendlyFireKillFeedType = notifcationSender.GetFriendlyFireKillFeedType();
26 SCR_EFriendlyFireKillFeedType friendlyFireKillFeedTypeDefault = EKillFeedReceiveType.GROUP_ONLY;
27 if (source)
28 source.Get("m_eFriendlyFireKillFeedType", friendlyFireKillFeedTypeDefault);
29
30 if (killFeedType == killFeedTypeDefault &&
31 receivekillFeedType == receivekillFeedTypeDefault &&
32 friendlyFireKillFeedType == friendlyFireKillFeedTypeDefault)
33 return ESerializeResult.DEFAULT;
34
35 context.WriteValue("version", 1);
36 context.WriteDefault(killFeedType, killFeedTypeDefault);
37 context.WriteDefault(receivekillFeedType, receivekillFeedTypeDefault);
38 context.WriteDefault(friendlyFireKillFeedType, friendlyFireKillFeedTypeDefault);
39 return ESerializeResult.OK;
40 }
41
42 //------------------------------------------------------------------------------------------------
43 override protected bool Deserialize(notnull IEntity owner, notnull GenericComponent component, notnull LoadContext context)
44 {
45 SCR_NotificationSenderComponent notifcationSender = SCR_NotificationSenderComponent.Cast(component);
46
47 int version;
48 context.Read(version);
49
50 EKillFeedType killFeedType;
51 if (context.Read(killFeedType))
52 notifcationSender.SetKillFeedType(killFeedType);
53
54 EKillFeedReceiveType receivekillFeedType;
55 if (context.Read(receivekillFeedType))
56 notifcationSender.SetReceiveKillFeedType(receivekillFeedType);
57
58 SCR_EFriendlyFireKillFeedType friendlyFireKillFeedType;
59 if (context.Read(friendlyFireKillFeedType))
60 notifcationSender.SetFriendlyFireKillFeedType(friendlyFireKillFeedType);
61
62 return true;
63 }
64}
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