DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
CreditsLoader.c
См. документацию.
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
13
14 for (int index_dep = 0; index_dep < 3; ++index_dep)
15 {
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()
Определения CreditsLoader.c:5
static JsonDataCredits GetData()
Определения CreditsLoader.c:43
static const string JSON_FILE_PATH
Определения CreditsLoader.c:3
Определения CreditsLoader.c:2
ref array< ref JsonDataCreditsDepartment > Departments
Определения JsonDataCredits.c:3
ref array< ref JsonDataCreditsSection > Sections
Определения JsonDataCreditsDepartment.c:4
Определения JsonDataCredits.c:2
string SectionName
Определения JsonDataCreditsSection.c:3
ref array< string > SectionLines
Определения JsonDataCreditsSection.c:4
Определения EnMath.c:7
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
enum ShapeType ErrorEx
static proto int RandomInt(int min, int max)
Returns a random int number between and min [inclusive] and max [exclusive].