Dayz
Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Toggle main menu visibility
Loading...
Searching...
No Matches
creditsloader.c
Go to the documentation of this file.
1
class
CreditsLoader
2
{
3
protected
static
const
string
JSON_FILE_PATH
=
"scripts/data/credits.json"
;
4
5
static
void
CreateTestJson
()
6
{
7
string
nameDepartment =
"Department"
;
8
string
nameSection =
"Section"
;
9
string
nameLine =
"Line"
;
10
11
JsonDataCredits
data =
new
JsonDataCredits
();
12
data.
Departments
=
new
array<ref JsonDataCreditsDepartment>
;
13
14
for
(
int
index_dep = 0; index_dep < 3; ++index_dep)
15
{
16
JsonDataCreditsDepartment
department =
new
JsonDataCreditsDepartment
();
17
department.
Sections
=
new
array<ref JsonDataCreditsSection>
();
18
department.
DepartmentName
= (nameDepartment +
" "
+ index_dep);
19
20
for
(
int
index_sec = 0; index_sec < 4; ++index_sec)
21
{
22
JsonDataCreditsSection
section =
new
JsonDataCreditsSection
();
23
section.
SectionLines
=
new
array<string>
;
24
section.
SectionName
= (nameSection +
" "
+ index_sec);
25
26
int
linesCount =
Math
.
RandomInt
(3, 10);
27
for
(
int
i = 0; i < linesCount; ++i)
28
{
29
section.
SectionLines
.Insert(nameLine +
" "
+ i);
30
}
31
32
department.
Sections
.Insert(section);
33
}
34
35
data.
Departments
.Insert(department);
36
}
37
38
string
errorMessage;
39
if
(!JsonFileLoader<ref JsonDataCredits>.SaveFile(
JSON_FILE_PATH
, data, errorMessage))
40
ErrorEx
(errorMessage);
41
}
42
43
static
JsonDataCredits
GetData
()
44
{
45
string
errorMessage;
46
JsonDataCredits
data;
47
48
if
(!JsonFileLoader<ref JsonDataCredits>.LoadFile(
JSON_FILE_PATH
, data, errorMessage))
49
ErrorEx
(errorMessage);
50
51
return
data;
52
}
53
}
CreditsLoader
Definition
creditsloader.c:2
CreditsLoader::GetData
static JsonDataCredits GetData()
Definition
creditsloader.c:43
CreditsLoader::CreateTestJson
static void CreateTestJson()
Definition
creditsloader.c:5
CreditsLoader::JSON_FILE_PATH
static const string JSON_FILE_PATH
Definition
creditsloader.c:3
JsonDataCreditsDepartment
Definition
jsondatacreditsdepartment.c:2
JsonDataCreditsDepartment::Sections
ref array< ref JsonDataCreditsSection > Sections
Definition
jsondatacreditsdepartment.c:4
JsonDataCreditsDepartment::DepartmentName
string DepartmentName
Definition
jsondatacreditsdepartment.c:3
JsonDataCredits
Definition
jsondatacredits.c:2
JsonDataCredits::Departments
ref array< ref JsonDataCreditsDepartment > Departments
Definition
jsondatacredits.c:3
JsonDataCreditsSection
Definition
jsondatacreditssection.c:2
JsonDataCreditsSection::SectionLines
ref array< string > SectionLines
Definition
jsondatacreditssection.c:4
JsonDataCreditsSection::SectionName
string SectionName
Definition
jsondatacreditssection.c:3
Math
Definition
enmath.c:7
array
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
Definition
isboxcollidinggeometryproxyclasses.c:28
ErrorEx
enum ShapeType ErrorEx
Math::RandomInt
static proto int RandomInt(int min, int max)
Returns a random int number between and min [inclusive] and max [exclusive].
Games
Dayz
scripts
3_game
gui
credits
creditsloader.c
Generated by
1.17.0