DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ CreateTestJson()

static void CreditsLoader::CreateTestJson ( )
inlinestaticprotected

См. определение в файле CreditsLoader.c строка 5

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 }
static const string JSON_FILE_PATH
Определения CreditsLoader.c:3
ref array< ref JsonDataCreditsDepartment > Departments
Определения JsonDataCredits.c:3
ref array< ref JsonDataCreditsSection > Sections
Определения JsonDataCreditsDepartment.c:4
string SectionName
Определения JsonDataCreditsSection.c:3
ref array< string > SectionLines
Определения JsonDataCreditsSection.c:4
enum ShapeType ErrorEx

Перекрестные ссылки JsonDataCreditsDepartment::DepartmentName, JsonDataCredits::Departments, ErrorEx, JSON_FILE_PATH, Math::RandomInt(), JsonDataCreditsSection::SectionLines, JsonDataCreditsSection::SectionName и JsonDataCreditsDepartment::Sections.