Dayz Explorer
1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
playerlightmanager.c
Go to the documentation of this file.
1
class
ActionTargetLighSource
:
ActionTarget
2
{
3
bool
m_Remove;
4
}
5
6
//WIP
7
class
PlayerLightManager
8
{
9
int
m_SelectedLightSource
;
10
ref
ActionTargetLighSource
m_LightItemTarget
;
11
ref
array<ref ActionTarget>
m_ValidLightItems
;
12
PlayerBase
m_Player
;
13
14
void
PlayerLightManager
(
PlayerBase
player)
15
{
16
m_LightItemTarget
=
null
;
17
m_ValidLightItems
=
new
array<ref ActionTarget>
;
18
m_Player
= player;
19
}
20
21
// can be anything, as long as it has appropriate actions for handling lights, see Mich2001Helmet
22
void
AddLightSource
(
Object
object
)
23
{
24
m_LightItemTarget
=
new
ActionTargetLighSource
(
object
,
null
, -1,
vector
.Zero, -1);
25
UpdateLightSourceList
();
26
}
27
28
void
RemoveLightSource
(
Object
object
)
29
{
30
m_LightItemTarget
=
new
ActionTargetLighSource
(
object
,
null
, -1,
vector
.Zero, -1);
31
m_LightItemTarget
.m_Remove =
true
;
32
UpdateLightSourceList
();
33
}
34
35
void
UpdateLightSourceList
()
36
{
37
if
(
m_LightItemTarget
)
38
{
39
if
( !
m_LightItemTarget
.m_Remove )
40
{
41
m_ValidLightItems
.Insert(
m_LightItemTarget
);
42
}
43
else
44
{
45
m_ValidLightItems
.RemoveItem(
m_LightItemTarget
);
46
}
47
}
48
}
49
50
ref
array<ref ActionTarget>
GetLightSourceList
()
51
{
52
return
m_ValidLightItems
;
53
}
54
55
void
SetSelectedLightSourceIdx
(
int
value)
56
{
57
m_SelectedLightSource
= value;
58
}
59
60
int
GetSelectedLightSourceIdx
()
61
{
62
return
m_SelectedLightSource
;
63
}
64
65
void
SelectLightSourceTarget
(
ActionTarget
target)
//should be ActionTarget?
66
{
67
int
idx =
m_ValidLightItems
.Find(target);
68
SetSelectedLightSourceIdx
(idx);
69
}
70
71
ref
ActionTarget
GetSelectedLightSourceTarget
()
72
{
73
return
m_ValidLightItems
.Get(
m_SelectedLightSource
);
74
}
75
};
GetSelectedLightSourceTarget
ref ActionTarget GetSelectedLightSourceTarget()
Definition:
playerlightmanager.c:71
RemoveLightSource
void RemoveLightSource(Object object)
Definition:
playerlightmanager.c:28
SelectLightSourceTarget
void SelectLightSourceTarget(ActionTarget target)
Definition:
playerlightmanager.c:65
ActionTargetLighSource
Definition:
playerlightmanager.c:1
SetSelectedLightSourceIdx
void SetSelectedLightSourceIdx(int value)
Definition:
playerlightmanager.c:55
PlayerLightManager
void PlayerLightManager(PlayerBase player)
Definition:
playerlightmanager.c:14
GetLightSourceList
ref array< ref ActionTarget > GetLightSourceList()
Definition:
playerlightmanager.c:50
m_ValidLightItems
ref array< ref ActionTarget > m_ValidLightItems
Definition:
playerlightmanager.c:11
PlayerBase
Definition:
playerbaseclient.c:1
vector
Definition:
enconvert.c:105
ActionTarget
class ActionTargets ActionTarget
m_Player
PlayerBase m_Player
Definition:
playerlightmanager.c:12
GetSelectedLightSourceIdx
int GetSelectedLightSourceIdx()
Definition:
playerlightmanager.c:60
m_SelectedLightSource
ActionTargetLighSource m_SelectedLightSource
Object
Definition:
objecttyped.c:1
UpdateLightSourceList
void UpdateLightSourceList()
Definition:
playerlightmanager.c:35
array< ref ActionTarget >
m_LightItemTarget
ref ActionTargetLighSource m_LightItemTarget
Definition:
playerlightmanager.c:10
AddLightSource
void AddLightSource(Object object)
Definition:
playerlightmanager.c:22
DAYZ
scripts_v1.24.157551
scripts
world
classes
playerlightmanager.c
Generated by
1.8.17