DayZ
1.24
Loading...
Searching...
No Matches
RandomGeneratorSyncManager.c
Go to the documentation of this file.
1
enum
RandomGeneratorSyncUsage
2
{
3
RGSRecoil
,
4
RGSJam
,
5
RGSGeneric
,
6
RGSAimingModel
,
7
Count
,
8
}
9
10
class
RandomGeneratorSyncManager
11
{
12
const
int
USAGE_COUNT
=
RandomGeneratorSyncUsage
.Count;
13
14
float
randomValuesArray
[
USAGE_COUNT
];
15
DayZPlayer
m_player
;
16
17
void
RandomGeneratorSyncManager
(
DayZPlayer
player
)
18
{
19
m_player
=
player
;
20
}
21
22
void
Update
()
23
{
24
for
(
int
i
= 0;
i
<
USAGE_COUNT
;
i
++)
25
randomValuesArray
[
i
] =
m_player
.Random01();
26
}
27
28
29
float
GetRandom01
(
RandomGeneratorSyncUsage
usage_index
)
30
{
31
if
(
usage_index
<
USAGE_COUNT
)
32
return
randomValuesArray
[
usage_index
];
33
return
-1;
34
}
35
36
float
GetRandomInRange
(
RandomGeneratorSyncUsage
usage_index
,
float
min
,
float
max
)
37
{
38
return
GetRandom01
(
usage_index
) * (
max
-
min
) +
min
;
39
}
40
}
randomValuesArray
float randomValuesArray[USAGE_COUNT]
Definition
RandomGeneratorSyncManager.c:14
GetRandomInRange
float GetRandomInRange(RandomGeneratorSyncUsage usage_index, float min, float max)
Definition
RandomGeneratorSyncManager.c:36
GetRandom01
float GetRandom01(RandomGeneratorSyncUsage usage_index)
Definition
RandomGeneratorSyncManager.c:29
RandomGeneratorSyncManager
void RandomGeneratorSyncManager(DayZPlayer player)
Definition
RandomGeneratorSyncManager.c:17
USAGE_COUNT
enum RandomGeneratorSyncUsage USAGE_COUNT
m_player
DayZPlayer m_player
Definition
RandomGeneratorSyncManager.c:15
RandomGeneratorSyncUsage
RandomGeneratorSyncUsage
Definition
RandomGeneratorSyncManager.c:2
RGSJam
@ RGSJam
Definition
RandomGeneratorSyncManager.c:4
RGSRecoil
@ RGSRecoil
Definition
RandomGeneratorSyncManager.c:3
Count
@ Count
Definition
RandomGeneratorSyncManager.c:7
RGSAimingModel
@ RGSAimingModel
Definition
RandomGeneratorSyncManager.c:6
RGSGeneric
@ RGSGeneric
Definition
RandomGeneratorSyncManager.c:5
DayZPlayer
Definition
DayZPlayerImplement.c:71
Param3
Definition
EntityAI.c:95
Update
proto native volatile void Update()
Definition
PlayerSoundManager.c:118
scripts
4_World
Classes
RandomGeneratorSyncManager.c
Generated by
1.10.0