Arma Reforger Explorer
1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Toggle main menu visibility
Loading...
Searching...
No Matches
AIFormationComponentSerializer.c
Go to the documentation of this file.
1
class
AIFormationComponentSerializer
:
ScriptedComponentSerializer
2
{
3
//------------------------------------------------------------------------------------------------
4
override
static
typename
GetTargetType
()
5
{
6
return
AIFormationComponent
;
7
}
8
9
//------------------------------------------------------------------------------------------------
10
override
protected
ESerializeResult
Serialize
(notnull
IEntity
owner, notnull
GenericComponent
component, notnull
SaveContext
context)
11
{
12
const
AIFormationComponent
aiFormation =
AIFormationComponent
.Cast(component);
13
auto
formation = aiFormation.GetFormation();
14
if
(!formation)
15
return
ESerializeResult
.DEFAULT;
16
17
string
defaultFormation;
18
if
(component.GetComponentSource(owner).Get(
"DefaultFormation"
, defaultFormation) && defaultFormation == formation.GetName())
19
return
ESerializeResult
.DEFAULT;
20
21
context.WriteValue(
"version"
, 1);
22
context.WriteValue(
"formation"
, formation.GetName());
23
return
ESerializeResult
.OK;
24
}
25
26
//------------------------------------------------------------------------------------------------
27
override
protected
bool
Deserialize
(notnull
IEntity
owner, notnull
GenericComponent
component, notnull
LoadContext
context)
28
{
29
AIFormationComponent
aiFormation =
AIFormationComponent
.Cast(component);
30
31
int
version;
32
context.Read(version);
33
34
string
formation;
35
context.Read(formation);
36
37
aiFormation.SetFormation(formation);
38
return
true
;
39
}
40
}
GetTargetType
class SCR_PersistentThreatSector GetTargetType()
Definition
AIControlComponentSerializer.c:12
AIFormationComponent
Definition
AIFormationComponent.c:13
AIFormationComponentSerializer
Definition
AIFormationComponentSerializer.c:2
AIFormationComponentSerializer::Deserialize
bool Deserialize(notnull IEntity owner, notnull GenericComponent component, notnull LoadContext context)
Definition
AIFormationComponentSerializer.c:27
AIFormationComponentSerializer::Serialize
ESerializeResult Serialize(notnull IEntity owner, notnull GenericComponent component, notnull SaveContext context)
Definition
AIFormationComponentSerializer.c:10
GenericComponent
Definition
GenericComponent.c:13
IEntity
Definition
IEntity.c:13
LoadContext
Definition
LoadContext.c:17
SaveContext
Definition
SaveContext.c:17
ScriptedComponentSerializer
Definition
ScriptedComponentSerializer.c:13
ESerializeResult
ESerializeResult
Definition
ESerializeResult.c:13
scripts
Game
Plugins
Persistence
System
Serializers
Components
AI
AIFormationComponentSerializer.c
Generated by
1.17.0