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_BaseAIFactionCommander.c
Go to the documentation of this file.
1
[
BaseContainerProps
()]
2
class
SCR_BaseAIFactionCommander
3
{
4
[
Attribute
()]
5
protected
FactionKey
m_sFactionKey
;
6
7
protected
SCR_FactionCommanderHandlerComponent
m_FactionCommanderHandlerComponent
;
8
protected
SCR_Faction
m_Faction
;
9
protected
bool
m_bIsAICommanderActivated
10
11
//------------------------------------------------------------------------------------------------
12
protected
void
OnAICommanderActivated
()
13
{
14
m_bIsAICommanderActivated =
true
;
15
}
16
17
//------------------------------------------------------------------------------------------------
18
protected
void
OnAICommanderDeactivated
()
19
{
20
m_bIsAICommanderActivated =
false
;
21
}
22
23
//------------------------------------------------------------------------------------------------
24
protected
void
OnFactionCommanderChanged
(notnull
SCR_Faction
faction,
int
commanderPlayerId)
25
{
26
if
(faction !=
m_Faction
)
27
return
;
28
29
UpdateAICommanderState
();
30
}
31
32
//------------------------------------------------------------------------------------------------
35
void
Init
(notnull SCR_FactionCommanderHandlerComponent factionCommanderHandlerComponent)
36
{
37
m_FactionCommanderHandlerComponent
= factionCommanderHandlerComponent;
38
39
FactionManager factionManager =
GetGame
().GetFactionManager();
40
if
(!factionManager)
41
return
;
42
43
m_Faction
=
SCR_Faction
.Cast(factionManager.GetFactionByKey(
m_sFactionKey
));
44
if
(!
m_Faction
)
45
return
;
46
47
UpdateAICommanderState
();
48
49
m_FactionCommanderHandlerComponent
.GetOnFactionCommanderChanged().Insert(
OnFactionCommanderChanged
);
50
}
51
52
//------------------------------------------------------------------------------------------------
54
void
Deinit
()
55
{
56
if
(!
m_FactionCommanderHandlerComponent
)
57
return
;
58
59
m_FactionCommanderHandlerComponent
.GetOnFactionCommanderChanged().Remove(
OnFactionCommanderChanged
);
60
}
61
62
//------------------------------------------------------------------------------------------------
63
protected
void
UpdateAICommanderState
()
64
{
65
if
(!
m_Faction
)
66
return
;
67
68
bool
isAICommander =
m_Faction
.IsAICommander();
69
if
(isAICommander == m_bIsAICommanderActivated)
70
return
;
71
72
if
(isAICommander)
73
OnAICommanderActivated
();
74
else
75
OnAICommanderDeactivated
();
76
}
77
}
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
BaseContainerProps
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
Definition
SCR_AIAnimationWaypoint.c:14
FactionKey
Definition
FactionKey.c:3
SCR_BaseAIFactionCommander
Definition
SCR_BaseAIFactionCommander.c:3
SCR_BaseAIFactionCommander::OnAICommanderActivated
void OnAICommanderActivated()
Definition
SCR_BaseAIFactionCommander.c:12
SCR_BaseAIFactionCommander::m_sFactionKey
FactionKey m_sFactionKey
Definition
SCR_BaseAIFactionCommander.c:5
SCR_BaseAIFactionCommander::UpdateAICommanderState
void UpdateAICommanderState()
Definition
SCR_BaseAIFactionCommander.c:63
SCR_BaseAIFactionCommander::Init
void Init(notnull SCR_FactionCommanderHandlerComponent factionCommanderHandlerComponent)
Definition
SCR_BaseAIFactionCommander.c:35
SCR_BaseAIFactionCommander::OnFactionCommanderChanged
void OnFactionCommanderChanged(notnull SCR_Faction faction, int commanderPlayerId)
Definition
SCR_BaseAIFactionCommander.c:24
SCR_BaseAIFactionCommander::OnAICommanderDeactivated
void OnAICommanderDeactivated()
Definition
SCR_BaseAIFactionCommander.c:18
SCR_BaseAIFactionCommander::m_Faction
SCR_Faction m_Faction
Definition
SCR_BaseAIFactionCommander.c:8
SCR_BaseAIFactionCommander::m_FactionCommanderHandlerComponent
SCR_FactionCommanderHandlerComponent m_FactionCommanderHandlerComponent
Definition
SCR_BaseAIFactionCommander.c:7
SCR_BaseAIFactionCommander::Deinit
void Deinit()
Deinit AI faction commander.
Definition
SCR_BaseAIFactionCommander.c:54
SCR_Faction
Definition
SCR_Faction.c:6
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
scripts
Game
FactionCommander
AI
SCR_BaseAIFactionCommander.c
Generated by
1.17.0