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_TaskExecutorEntity.c
Go to the documentation of this file.
1
class
SCR_TaskExecutorEntity
:
SCR_TaskExecutor
2
{
3
[
Attribute
()]
4
protected
RplId
m_EntityRplID
;
5
6
//------------------------------------------------------------------------------------------------
7
override
bool
IsClonedBy
(
SCR_TaskExecutor
executor)
8
{
9
if
(!super.IsClonedBy(executor))
10
return
false
;
11
12
SCR_TaskExecutorEntity
executorEntity =
SCR_TaskExecutorEntity
.Cast(executor);
13
if
(!executorEntity)
14
return
false
;
15
16
RplComponent rpl = RplComponent.Cast(
GetEntity
().FindComponent(RplComponent));
17
if
(!rpl)
18
return
false
;
19
20
RplId
rplID = rpl.Id();
21
if
(!rplID.IsValid())
22
return
false
;
23
24
rpl = RplComponent.Cast(executorEntity.
GetEntity
().
FindComponent
(RplComponent));
25
if
(!rpl)
26
return
false
;
27
28
RplId
otherRplID = rpl.Id();
29
if
(!otherRplID.IsValid())
30
return
false
;
31
32
if
(rplID != otherRplID)
33
return
false
;
34
35
return
true
;
36
}
37
38
//------------------------------------------------------------------------------------------------
39
IEntity
GetEntity
()
40
{
41
RplComponent rpl = RplComponent.Cast(
Replication
.FindItem(
m_EntityRplID
));
42
if
(!rpl)
43
return
null;
44
45
return
rpl.GetEntity();
46
}
47
48
//------------------------------------------------------------------------------------------------
49
void
SetEntity
(
IEntity
ent)
50
{
51
RplComponent rpl = RplComponent.Cast(ent.
FindComponent
(RplComponent));
52
if
(!rpl)
53
return
;
54
55
RplId
rplID = rpl.Id();
56
if
(!rplID)
57
return
;
58
59
m_EntityRplID
= rplID;
60
}
61
62
//------------------------------------------------------------------------------------------------
63
override
FactionKey
GetFactionKey
()
64
{
65
IEntity
entity =
GetEntity
();
66
if
(!entity)
67
return
FactionKey
.Empty;
68
69
FactionAffiliationComponent factionAffiliationComponent = FactionAffiliationComponent.Cast(entity.
FindComponent
(FactionAffiliationComponent));
70
if
(!factionAffiliationComponent)
71
return
FactionKey
.Empty;
72
73
return
factionAffiliationComponent.GetAffiliatedFactionKey();
74
}
75
76
//------------------------------------------------------------------------------------------------
77
override
int
GetGroupID
()
78
{
79
IEntity
entity =
GetEntity
();
80
if
(!entity)
81
return
-1;
82
83
SCR_AICombatComponent aiCombatComponent = SCR_AICombatComponent.Cast(entity.
FindComponent
(SCR_AICombatComponent));
84
if
(!aiCombatComponent)
85
return
-1;
86
87
SCR_ChimeraAIAgent
agent = aiCombatComponent.GetAiAgent();
88
if
(!agent)
89
return
-1;
90
91
SCR_AIGroup
group =
SCR_AIGroup
.Cast(agent.GetParentGroup());
92
if
(!group)
93
return
-1;
94
95
return
group.
GetGroupID
();
96
}
97
98
//------------------------------------------------------------------------------------------------
99
static
bool
Extract
(
SCR_TaskExecutorEntity
instance,
ScriptCtx
ctx,
SSnapSerializerBase
snapshot)
100
{
101
snapshot.SerializeBytes(instance.
m_EntityRplID
, 4);
102
return
true
;
103
}
104
105
//------------------------------------------------------------------------------------------------
106
static
bool
Inject
(
SSnapSerializerBase
snapshot,
ScriptCtx
ctx,
SCR_TaskExecutorEntity
instance)
107
{
108
snapshot.SerializeBytes(instance.
m_EntityRplID
, 4);
109
return
true
;
110
}
111
112
//------------------------------------------------------------------------------------------------
113
static
void
Encode
(
SSnapSerializerBase
snapshot,
ScriptCtx
ctx, ScriptBitSerializer packet)
114
{
115
RplId
entityRplID;
116
snapshot.SerializeBytes(entityRplID, 4);
117
packet.Serialize(entityRplID, 32);
118
}
119
120
//------------------------------------------------------------------------------------------------
121
static
bool
Decode
(ScriptBitSerializer packet,
ScriptCtx
ctx,
SSnapSerializerBase
snapshot)
122
{
123
RplId
entityRplID;
124
packet.Serialize(entityRplID, 32);
125
snapshot.SerializeBytes(entityRplID, 4);
126
127
return
true
;
128
}
129
130
//------------------------------------------------------------------------------------------------
131
static
bool
SnapCompare
(
SSnapSerializerBase
lhs,
SSnapSerializerBase
rhs ,
ScriptCtx
ctx)
132
{
133
return
lhs.CompareSnapshots(rhs, 4);
134
}
135
136
//------------------------------------------------------------------------------------------------
137
static
bool
PropCompare
(
SCR_TaskExecutorEntity
instance,
SSnapSerializerBase
snapshot,
ScriptCtx
ctx)
138
{
139
return
snapshot.Compare(instance.
m_EntityRplID
, 4);
140
}
141
}
FactionKey
Definition
FactionKey.c:3
IEntity
Definition
IEntity.c:13
IEntity::FindComponent
proto external Managed FindComponent(typename typeName)
Replication
Main replication API.
Definition
Replication.c:14
RplId
Replication item identifier.
Definition
RplId.c:14
SCR_AIGroup
Definition
SCR_AIGroup.c:75
SCR_AIGroup::GetGroupID
int GetGroupID()
Definition
SCR_AIGroup.c:935
SCR_ChimeraAIAgent
Definition
SCR_ChimeraAIAgent.c:6
SCR_TaskExecutorEntity
Definition
SCR_TaskExecutorEntity.c:2
SCR_TaskExecutorEntity::GetFactionKey
override FactionKey GetFactionKey()
Definition
SCR_TaskExecutorEntity.c:63
SCR_TaskExecutorEntity::PropCompare
static bool PropCompare(SCR_TaskExecutorEntity instance, SSnapSerializerBase snapshot, ScriptCtx ctx)
Definition
SCR_TaskExecutorEntity.c:137
SCR_TaskExecutorEntity::SetEntity
void SetEntity(IEntity ent)
Definition
SCR_TaskExecutorEntity.c:49
SCR_TaskExecutorEntity::GetGroupID
override int GetGroupID()
Definition
SCR_TaskExecutorEntity.c:77
SCR_TaskExecutorEntity::GetEntity
IEntity GetEntity()
Definition
SCR_TaskExecutorEntity.c:39
SCR_TaskExecutorEntity::Extract
static bool Extract(SCR_TaskExecutorEntity instance, ScriptCtx ctx, SSnapSerializerBase snapshot)
Definition
SCR_TaskExecutorEntity.c:99
SCR_TaskExecutorEntity::SnapCompare
static bool SnapCompare(SSnapSerializerBase lhs, SSnapSerializerBase rhs, ScriptCtx ctx)
Definition
SCR_TaskExecutorEntity.c:131
SCR_TaskExecutorEntity::Inject
static bool Inject(SSnapSerializerBase snapshot, ScriptCtx ctx, SCR_TaskExecutorEntity instance)
Definition
SCR_TaskExecutorEntity.c:106
SCR_TaskExecutorEntity::Encode
static void Encode(SSnapSerializerBase snapshot, ScriptCtx ctx, ScriptBitSerializer packet)
Definition
SCR_TaskExecutorEntity.c:113
SCR_TaskExecutorEntity::Decode
static bool Decode(ScriptBitSerializer packet, ScriptCtx ctx, SSnapSerializerBase snapshot)
Definition
SCR_TaskExecutorEntity.c:121
SCR_TaskExecutorEntity::IsClonedBy
override bool IsClonedBy(SCR_TaskExecutor executor)
Definition
SCR_TaskExecutorEntity.c:7
SCR_TaskExecutorEntity::m_EntityRplID
RplId m_EntityRplID
Definition
SCR_TaskExecutorEntity.c:4
SCR_TaskExecutor
Definition
SCR_TaskExecutor.c:2
SSnapSerializerBase
Definition
EnNetwork.c:269
ScriptCtx
Definition
EnNetwork.c:36
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
scripts
Game
Tasks
Executors
SCR_TaskExecutorEntity.c
Generated by
1.17.0