-
Notifications
You must be signed in to change notification settings - Fork 12
/
Variables.h
193 lines (169 loc) · 4.29 KB
/
Variables.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
#ifndef VARIABLES_H_INCLUDED
#define VARIABLES_H_INCLUDED
#include <wx/wx.h>
#include <wx/dynarray.h>
#include <wx/arrimpl.cpp>
enum FSGames
{
FS2011,
FS2013,
NumOfFSGames,
};
struct GameSearchPaths
{
wxString game;
wxArrayString installLocations;
wxString savegameLocation;
};
struct LangList
{
wxArrayString names;
wxArrayString fileNames;
wxArrayLong identifiers;
};
struct Savegames
{
wxArrayShort isValid;
wxArrayString name;
wxArrayShort isMod;
wxArrayShort isZip;
wxArrayString mapId;
wxArrayString mapFile;
wxArrayInt mapWidth;
wxArrayInt mapHeight;
wxArrayString courseplayFile;
void Add(short IsValid,
wxString MapName,
short IsMod = false,
short IsZip = false,
wxString MapId = wxEmptyString,
wxString MapFile = wxEmptyString,
int width = 0,
int height = 0,
wxString CourseplayFile = wxEmptyString)
{
isValid.Add(IsValid);
name.Add(MapName);
isMod.Add(IsMod);
isZip.Add(IsZip);
mapId.Add(MapId);
mapFile.Add(MapFile);
mapWidth.Add(width);
mapHeight.Add(height);
courseplayFile.Add(CourseplayFile);
}
void Alloc(size_t nCount)
{
isValid.Alloc(nCount);
name.Alloc(nCount);
isMod.Alloc(nCount);
isZip.Alloc(nCount);
mapId.Alloc(nCount);
mapFile.Alloc(nCount);
mapWidth.Alloc(nCount);
mapHeight.Alloc(nCount);
courseplayFile.Alloc(nCount);
}
void Clear()
{
isValid.Clear();
name.Clear();
isMod.Clear();
isZip.Clear();
mapId.Clear();
mapFile.Clear();
mapWidth.Clear();
mapHeight.Clear();
courseplayFile.Clear();
}
size_t Count()
{
return isValid.Count();
}
};
class CourseData
{
public: // Functions
CourseData();
~CourseData();
void Add(wxDouble PosX,
wxDouble PosY,
wxDouble Angle,
short Wait,
short Crossing,
short Reverse,
wxDouble Speed,
// For Courseplay 3.4+
wxString Turn = wxEmptyString,
short TurnStart = 0,
short TurnEnd = 0,
short Ridgemarker = 0,
wxString Generated = wxEmptyString
);
void Alloc(size_t nCount);
void Clear();
size_t Count();
public: // Variables
wxArrayDouble posX;
wxArrayDouble posY;
wxArrayDouble angle;
wxArrayShort wait;
wxArrayShort crossing;
wxArrayShort rev;
wxArrayDouble speed;
// variables under here is for Courseplay 3.4+
wxArrayString turn; // false, left, right
wxArrayShort turnStart;
wxArrayShort turnEnd;
wxArrayShort ridgemarker; // 0 = off, 1 = left, 2 = right
wxArrayString generated; // false, true
};
WX_DECLARE_OBJARRAY(CourseData, ArrayCourseData);
//WX_DEFINE_OBJARRAY(ArrayCourseData);
struct SavegameData
{
// CP Hud Data
wxDouble posX;
wxDouble posY;
void SetHud(wxDouble PosX = 0.43299999833107, wxDouble PosY = 0.0020000000949949)
{
posX = PosX;
posY = PosY;
}
// CP Course Data
wxArrayString name;
wxArrayInt id;
wxArrayLong numWaypoints;
ArrayCourseData course;
void Add(wxString Name,
int Id,
long NumWaypoints,
CourseData Course
)
{
name.Add(Name);
id.Add(Id);
numWaypoints.Add(NumWaypoints);
course.Add(Course);
}
void Alloc(size_t nCount)
{
name.Alloc(nCount);
id.Alloc(nCount);
numWaypoints.Alloc(nCount);
course.Alloc(nCount);
}
void Clear()
{
name.Clear();
id.Clear();
numWaypoints.Clear();
course.Clear();
}
size_t Count()
{
return name.Count();
}
// Holds the savegame data to be used.
};
#endif // VARIABLES_H_INCLUDED