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_TaskExecutor.c
Go to the documentation of this file.
1
class
SCR_TaskExecutor
:
ScriptAndConfig
2
{
3
//------------------------------------------------------------------------------------------------
4
static
SCR_TaskExecutor
FromLocalPlayer()
5
{
6
return
FromPlayerID(
SCR_PlayerController
.
GetLocalPlayerId
());
7
}
8
9
//------------------------------------------------------------------------------------------------
10
static
SCR_TaskExecutor
FromPlayerID(
int
playerID)
11
{
12
SCR_TaskExecutorPlayer
executor =
new
SCR_TaskExecutorPlayer
();
13
executor.
SetPlayerID
(playerID);
14
15
return
executor;
16
}
17
18
//------------------------------------------------------------------------------------------------
19
static
SCR_TaskExecutor
FromEntity(
IEntity
ent)
20
{
21
if
(!ent)
22
return
null;
23
24
SCR_TaskExecutorEntity
executor =
new
SCR_TaskExecutorEntity
();
25
executor.
SetEntity
(ent);
26
27
return
executor;
28
}
29
30
//------------------------------------------------------------------------------------------------
31
static
SCR_TaskExecutor
FromGroup(
int
groupID)
32
{
33
SCR_TaskExecutorGroup
executor =
new
SCR_TaskExecutorGroup
();
34
executor.
SetGroupID
(groupID);
35
36
return
executor;
37
}
38
39
//------------------------------------------------------------------------------------------------
40
static
SCR_TaskExecutor
FindMatchingTaskExecutor(notnull array<ref SCR_TaskExecutor> container, out notnull
SCR_TaskExecutor
template
,
bool
recursive =
false
)
41
{
42
SCR_GroupsManagerComponent
groupsManagerComponent =
SCR_GroupsManagerComponent
.GetInstance();
43
if
(recursive && !groupsManagerComponent)
44
return
null;
45
46
SCR_AIGroup
group;
47
SCR_TaskExecutor
match;
48
foreach
(
SCR_TaskExecutor
e : container)
49
{
50
if
(!e)
51
continue
;
52
53
if
(e.IsClonedBy(
template
))
54
return
e;
55
56
if
(recursive &&
SCR_TaskExecutorGroup
.Cast(e))
57
{
58
group = groupsManagerComponent.FindGroup(e.GetGroupID());
59
if
(!group)
60
continue
;
61
62
array<int> groupMemberIDs = group.
GetPlayerIDs
();
63
if
(!groupMemberIDs || groupMemberIDs.IsEmpty())
64
continue
;
65
66
array<ref SCR_TaskExecutor> groupMemberExecutors = {};
67
SCR_TaskExecutor
groupMemberExecutor;
68
foreach
(
int
groupMemberID : groupMemberIDs)
69
{
70
groupMemberExecutor =
SCR_TaskExecutor
.FromPlayerID(groupMemberID);
71
if
(groupMemberExecutor)
72
groupMemberExecutors.Insert(groupMemberExecutor);
73
}
74
75
match =
SCR_TaskExecutor
.FindMatchingTaskExecutor(groupMemberExecutors,
template
);
76
if
(match)
77
return
match;
78
}
79
}
80
81
return
null;
82
}
83
84
//------------------------------------------------------------------------------------------------
85
bool
IsClonedBy(
SCR_TaskExecutor
executor)
86
{
87
if
(
Type
() != executor.Type())
88
return
false
;
89
90
return
true
;
91
}
92
93
//------------------------------------------------------------------------------------------------
94
FactionKey
GetFactionKey
()
95
{
96
return
FactionKey
.Empty;
97
}
98
99
//------------------------------------------------------------------------------------------------
100
int
GetGroupID
()
101
{
102
return
-1;
103
}
104
}
GetGroupID
int GetGroupID()
Definition
SCR_AIGroup.c:3806
SCR_GroupsManagerComponent
void SCR_GroupsManagerComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
Definition
SCR_GroupsManagerComponent.c:1747
GetFactionKey
FactionKey GetFactionKey()
Definition
SCR_ScenarioFrameworkLayerBase.c:384
Type
int Type
Definition
ScriptCamera.c:17
FactionKey
Definition
FactionKey.c:3
IEntity
Definition
IEntity.c:13
SCR_AIGroup
Definition
SCR_AIGroup.c:75
SCR_AIGroup::GetPlayerIDs
array< int > GetPlayerIDs()
Definition
SCR_AIGroup.c:978
SCR_PlayerController
Definition
SCR_PlayerController.c:31
SCR_PlayerController::GetLocalPlayerId
static int GetLocalPlayerId()
Returns either a valid ID of local player or 0.
Definition
SCR_PlayerController.c:481
SCR_TaskExecutorEntity
Definition
SCR_TaskExecutorEntity.c:2
SCR_TaskExecutorEntity::SetEntity
void SetEntity(IEntity ent)
Definition
SCR_TaskExecutorEntity.c:49
SCR_TaskExecutorGroup
Definition
SCR_TaskExecutorGroup.c:2
SCR_TaskExecutorGroup::SetGroupID
void SetGroupID(int groupID)
Definition
SCR_TaskExecutorGroup.c:43
SCR_TaskExecutor
Definition
SCR_TaskExecutor.c:2
SCR_TaskExecutorPlayer
Definition
SCR_TaskExecutorPlayer.c:2
SCR_TaskExecutorPlayer::SetPlayerID
void SetPlayerID(int playerID)
Definition
SCR_TaskExecutorPlayer.c:29
ScriptAndConfig
Definition
Types.c:124
scripts
Game
Tasks
Executors
SCR_TaskExecutor.c
Generated by
1.17.0