Arma Reforger Explorer
1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Toggle main menu visibility
Loading...
Searching...
No Matches
SCR_AIWaypointArtillerySupportSerializer.c
Go to the documentation of this file.
1
class
SCR_AIWaypointArtillerySupportSerializer
:
ScriptedEntitySerializer
2
{
3
//------------------------------------------------------------------------------------------------
4
override
static
typename
GetTargetType
()
5
{
6
return
SCR_AIWaypointArtillerySupport
;
7
}
8
9
//------------------------------------------------------------------------------------------------
10
override
protected
ESerializeResult
Serialize
(notnull
IEntity
entity, notnull
SaveContext
context)
11
{
12
const
SCR_AIWaypointArtillerySupport
artillerySupport =
SCR_AIWaypointArtillerySupport
.Cast(entity);
13
BaseContainer
source;
14
if
(artillerySupport.GetPrefabData())
15
source = artillerySupport.GetPrefabData().GetPrefab();
16
17
const
bool
active = artillerySupport.
IsActive
();
18
bool
activeDefault =
true
;
19
if
(source)
20
source.Get(
"m_bActive"
, activeDefault);
21
22
const
int
targetShotCount = artillerySupport.
GetTargetShotCount
();
23
int
targetShotCountDefault =
true
;
24
if
(source)
25
source.Get(
"m_iTargetShotCount"
, targetShotCountDefault);
26
27
const
SCR_EAIArtilleryAmmoType
ammoType = artillerySupport.
GetAmmoType
();
28
SCR_EAIArtilleryAmmoType
ammoTypeDefault =
SCR_EAIArtilleryAmmoType
.HIGH_EXPLOSIVE;
29
if
(source)
30
source.Get(
"m_eAmmoType"
, ammoTypeDefault);
31
32
context.StartObject(
"base"
);
33
const
ESerializeResult
baseResult = super.Serialize(entity, context);
34
context.EndObject();
35
if
(baseResult ==
ESerializeResult
.ERROR)
36
return
baseResult;
37
38
if
(baseResult ==
ESerializeResult
.DEFAULT &&
39
active == activeDefault &&
40
targetShotCount == targetShotCountDefault &&
41
ammoType == ammoTypeDefault)
42
{
43
return
baseResult;
44
}
45
46
context.WriteValue(
"version"
, 1);
47
context.WriteDefault(active, activeDefault);
48
context.WriteDefault(targetShotCount, targetShotCountDefault);
49
context.WriteDefault(ammoType, ammoTypeDefault);
50
return
ESerializeResult
.OK;
51
}
52
53
//------------------------------------------------------------------------------------------------
54
override
protected
bool
Deserialize
(notnull
IEntity
entity, notnull
LoadContext
context)
55
{
56
auto
artillerySupport =
SCR_AIWaypointArtillerySupport
.Cast(entity);
57
58
if
(context.DoesObjectExist(
"base"
))
59
{
60
if
(!context.StartObject(
"base"
) ||
61
!super.Deserialize(entity, context) ||
62
!context.EndObject())
63
{
64
return
false
;
65
}
66
}
67
68
int
version;
69
context.Read(version);
70
71
bool
active;
72
if
(context.Read(active))
73
artillerySupport.
SetActive
(active);
74
75
int
targetShotCount;
76
if
(context.Read(targetShotCount))
77
artillerySupport.SetTargetShotCount(targetShotCount);
78
79
SCR_EAIArtilleryAmmoType
ammoType;
80
if
(context.Read(ammoType))
81
artillerySupport.SetAmmoType(ammoType);
82
83
return
true
;
84
}
85
}
GetTargetType
class SCR_PersistentThreatSector GetTargetType()
Definition
AIControlComponentSerializer.c:12
SCR_EAIArtilleryAmmoType
SCR_EAIArtilleryAmmoType
Definition
SCR_AIStaticArtilleryVehicleUsageComponent.c:2
BaseContainer
Definition
BaseContainer.c:13
IEntity
Definition
IEntity.c:13
LoadContext
Definition
LoadContext.c:17
SCR_AIWaypointArtillerySupport
Definition
SCR_AIWaypointArtillerySupport.c:6
SCR_AIWaypointArtillerySupport::GetTargetShotCount
int GetTargetShotCount()
Definition
SCR_AIWaypointArtillerySupport.c:44
SCR_AIWaypointArtillerySupport::GetAmmoType
SCR_EAIArtilleryAmmoType GetAmmoType()
Definition
SCR_AIWaypointArtillerySupport.c:56
SCR_AIWaypointArtillerySupport::SetActive
void SetActive(bool value, bool invokeEvent=true)
Definition
SCR_AIWaypointArtillerySupport.c:26
SCR_AIWaypointArtillerySupport::IsActive
bool IsActive()
Definition
SCR_AIWaypointArtillerySupport.c:50
SCR_AIWaypointArtillerySupportSerializer
Definition
SCR_AIWaypointArtillerySupportSerializer.c:2
SCR_AIWaypointArtillerySupportSerializer::Serialize
ESerializeResult Serialize(notnull IEntity entity, notnull SaveContext context)
Definition
SCR_AIWaypointArtillerySupportSerializer.c:10
SCR_AIWaypointArtillerySupportSerializer::Deserialize
bool Deserialize(notnull IEntity entity, notnull LoadContext context)
Definition
SCR_AIWaypointArtillerySupportSerializer.c:54
SaveContext
Definition
SaveContext.c:17
ScriptedEntitySerializer
Definition
ScriptedEntitySerializer.c:13
ESerializeResult
ESerializeResult
Definition
ESerializeResult.c:13
scripts
Game
Plugins
Persistence
System
Serializers
Entities
SCR_AIWaypointArtillerySupportSerializer.c
Generated by
1.17.0