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_GadgetManagerComponentSerializer.c
Go to the documentation of this file.
1
class
SCR_GadgetManagerComponentSerializer
:
ScriptedComponentSerializer
2
{
3
//------------------------------------------------------------------------------------------------
4
override
static
typename
GetTargetType
()
5
{
6
return
SCR_GadgetManagerComponent
;
7
}
8
9
//------------------------------------------------------------------------------------------------
10
override
protected
ESerializeResult
Serialize
(notnull
IEntity
owner, notnull
GenericComponent
component, notnull
SaveContext
context)
11
{
12
const
SCR_GadgetManagerComponent
gadgetManager =
SCR_GadgetManagerComponent
.Cast(component);
13
14
const
UUID
gadgetId = GetSystem().GetId(gadgetManager.
GetHeldGadget
());
15
if
(gadgetId.IsNull())
16
return
ESerializeResult
.DEFAULT;
17
18
context.Write(gadgetId);
19
return
ESerializeResult
.OK;
20
}
21
22
//------------------------------------------------------------------------------------------------
23
override
protected
bool
Deserialize
(notnull
IEntity
owner, notnull
GenericComponent
component, notnull
LoadContext
context)
24
{
25
auto
gadgetManager =
SCR_GadgetManagerComponent
.Cast(component);
26
27
UUID
gadgetId;
28
if
(context.Read(gadgetId) && !gadgetId.IsNull())
29
{
30
Tuple1<SCR_GadgetManagerComponent>
ctx(gadgetManager);
31
PersistenceWhenAvailableTask
task
(
OnGadgetAvailable
, ctx);
32
GetSystem().WhenAvailable(gadgetId,
task
);
33
}
34
35
return
true
;
36
}
37
38
//------------------------------------------------------------------------------------------------
39
protected
static
void
OnGadgetAvailable
(Managed instance,
PersistenceDeferredDeserializeTask
task
,
bool
expired, Managed context)
40
{
41
auto
gadget =
IEntity
.Cast(instance);
42
if
(!gadget)
43
return
;
44
45
auto
ctx =
Tuple1<SCR_GadgetManagerComponent>
.Cast(context);
46
if
(ctx.param1)
47
ctx.param1.HandleInput(gadget, 1);
48
}
49
}
GetTargetType
class SCR_PersistentThreatSector GetTargetType()
Definition
AIControlComponentSerializer.c:12
task
from task
Definition
SCR_TaskNotificationConfigs.c:12
GenericComponent
Definition
GenericComponent.c:13
IEntity
Definition
IEntity.c:13
LoadContext
Definition
LoadContext.c:17
PersistenceDeferredDeserializeTask
Definition
PersistenceDeferredDeserializeTask.c:13
PersistenceWhenAvailableTask
Definition
PersistenceWhenAvailableTask.c:14
SCR_GadgetManagerComponent
Definition
SCR_GadgetManagerComponent.c:140
SCR_GadgetManagerComponent::GetHeldGadget
IEntity GetHeldGadget()
Definition
SCR_GadgetManagerComponent.c:191
SCR_GadgetManagerComponentSerializer
Definition
SCR_GadgetManagerComponentSerializer.c:2
SCR_GadgetManagerComponentSerializer::OnGadgetAvailable
static void OnGadgetAvailable(Managed instance, PersistenceDeferredDeserializeTask task, bool expired, Managed context)
Definition
SCR_GadgetManagerComponentSerializer.c:39
SCR_GadgetManagerComponentSerializer::Serialize
ESerializeResult Serialize(notnull IEntity owner, notnull GenericComponent component, notnull SaveContext context)
Definition
SCR_GadgetManagerComponentSerializer.c:10
SCR_GadgetManagerComponentSerializer::Deserialize
bool Deserialize(notnull IEntity owner, notnull GenericComponent component, notnull LoadContext context)
Definition
SCR_GadgetManagerComponentSerializer.c:23
SaveContext
Definition
SaveContext.c:17
ScriptedComponentSerializer
Definition
ScriptedComponentSerializer.c:13
UUID
Definition
UUID.c:28
ESerializeResult
ESerializeResult
Definition
ESerializeResult.c:13
Tuple1
void Tuple1(T1 p1)
Definition
tuple.c:37
scripts
Game
Plugins
Persistence
System
Serializers
Components
Character
SCR_GadgetManagerComponentSerializer.c
Generated by
1.17.0