Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
creditsloader.c
Go to the documentation of this file.
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
12 data.Departments = new array<ref JsonDataCreditsDepartment>;
13
14 for (int index_dep = 0; index_dep < 3; ++index_dep)
15 {
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 {
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
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}
static void CreateTestJson()
static JsonDataCredits GetData()
static const string JSON_FILE_PATH
Definition enmath.c:7
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
enum ShapeType ErrorEx