-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathObjectSpawner.cpp
More file actions
302 lines (241 loc) · 5.04 KB
/
ObjectSpawner.cpp
File metadata and controls
302 lines (241 loc) · 5.04 KB
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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
#include "ObjectSpawner.h"
#include "Common.h"
ObjectSpawner::ObjectSpawner(std::string n, std::string l, std::string mbu,
std::string ot1, std::string ot2, int minsd, int maxsd,
int ttl, int d, int mnoos, int r, int t, bool sdat,
bool ubr, bool ho, bool tov)
{
name = n;
layer = l;
modifiedByUser = mbu;
objectTemplate1 = ot1;
objectTemplate2 = ot2;
minSpawnDelay = minsd;
maxSpawnDelay = maxsd;
timeToLive = ttl;
distance = d;
maxNrOfObjectSpawned = mnoos;
radius = r;
team = t;
spawnDelayAtStart = sdat;
useButtonRadius = ubr;
holdObject = ho;
teamOnVehicle = tov;
}
ObjectSpawner::~ObjectSpawner()
{
std::cout << std::endl << "Destructor called on ObjectSpawner: " << name << std::endl;
}
void ObjectSpawner::Print()
{
std::cout << "ObjectTemplate.create ObjectSpawner " << name << std::endl
<< "ObjectTemplate.setObjectTemplate 1 " << objectTemplate1 << std::endl
<< "ObjectTemplate.setObjectTemplate 2 " << objectTemplate2 << std::endl
//<< "ObjectTemplate.setControlPointId " << controlPointID << std::endl
<< "ObjectTemplate.minSpawnDelay " << minSpawnDelay << std::endl
<< "ObjectTemplate.maxSpawnDelay " << maxSpawnDelay << std::endl
<< "ObjectTemplate.spawnDelayAtStart " << spawnDelayAtStart << std::endl
<< "ObjectTemplate.TimeToLive " << timeToLive << std::endl
<< "ObjectTemplate.maxNrOfObjectSpawned " << maxNrOfObjectSpawned << std::endl
<< "ObjectTemplate.team " << team << std::endl
<< "ObjectTemplate.teamOnVehicle " << teamOnVehicle << std::endl << std::endl;
}
int ObjectSpawner::SetName(std::string a)
{
if (a.empty())
{
report("ObjectSpawner SetName failed");
return 1;
}
name = a;
return 0;
}
std::string ObjectSpawner::GetName()
{
return name;
}
int ObjectSpawner::SetLayer(std::string a)
{
layer = a;
return 0;
}
std::string ObjectSpawner::GetLayer()
{
return layer;
}
int ObjectSpawner::SetModifiedByUser(std::string a)
{
if (a.empty())
{
report("ObjectSpawner SetModifiedByUser failed");
return 1;
}
modifiedByUser = a;
return 0;
}
std::string ObjectSpawner::GetModifiedByUser()
{
return modifiedByUser;
}
int ObjectSpawner::SetObjectTemplate1(std::string a)
{
if (a.empty())
{
report("ObjectSpawner SetObjectTemplate1 failed");
return 1;
}
objectTemplate1 = a;
return 0;
}
std::string ObjectSpawner::GetObjectTemplate1()
{
return objectTemplate1;
}
int ObjectSpawner::SetObjectTemplate2(std::string a)
{
if (a.empty())
{
report("ObjectSpawner SetObjectTemplate2 failed");
return 1;
}
objectTemplate2 = a;
return 0;
}
std::string ObjectSpawner::GetObjectTemplate2()
{
return objectTemplate2;
}
int ObjectSpawner::SetMinSpawnDelay(int a)
{
if (a < 0)
{
report("ObjectSpawner SetMinSpawnDelay failed");
return 1;
}
minSpawnDelay = a;
return 0;
}
int ObjectSpawner::GetMinSpawnDelay()
{
return minSpawnDelay;
}
int ObjectSpawner::SetMaxSpawnDelay(int a)
{
if (a < 0)
{
report("ObjectSpawner SetMaxSpawnDelay failed");
return 1;
}
maxSpawnDelay = a;
return 0;
}
int ObjectSpawner::GetMaxSpawnDelay()
{
return maxSpawnDelay;
}
int ObjectSpawner::SetTimeToLive(int a)
{
if (a < 0)
{
report("ObjectSpawner SetTimeToLive failed");
return 1;
}
timeToLive = a;
return 0;
}
int ObjectSpawner::GetTimeToLive()
{
return timeToLive;
}
int ObjectSpawner::SetDistance(int a)
{
if (a <= 0) //ObjectTemplate.Distance 0 crashes the game but DICE forgot to correct it in the editor
{
report("ObjectSpawner SetDistance failed");
return 1;
}
distance = a;
return 0;
}
int ObjectSpawner::GetDistance()
{
return distance;
}
int ObjectSpawner::SetMaxNrOfObjectSpawned(int a)
{
if (a < 0)
{
report("ObjectSpawner SetMaxNrOfObjectSpawned failed");
return 1;
}
maxNrOfObjectSpawned = a;
return 0;
}
int ObjectSpawner::GetMaxNrOfObjectSpawned()
{
return maxNrOfObjectSpawned;
}
int ObjectSpawner::SetRadius(int a)
{
if (a < 0)
{
report("ObjectSpawner SetRadius failed");
return 1;
}
radius = a;
return 0;
}
int ObjectSpawner::GetRadius()
{
return radius;
}
int ObjectSpawner::SetTeam(int a)
{
if (a != 0 && a != 1 && a != 2)
{
report("ObjectSpawner SetTeam failed");
return 1;
}
team = a;
return 0;
}
int ObjectSpawner::GetTeam()
{
return team;
}
int ObjectSpawner::SetSpawnDelayAtStart(bool a)
{
spawnDelayAtStart = a;
return 0;
}
bool ObjectSpawner::GetSpawnDelayAtStart()
{
return spawnDelayAtStart;
}
int ObjectSpawner::SetUseButtonRadius(bool a)
{
useButtonRadius = a;
return 0;
}
bool ObjectSpawner::GetUseButtonRadius()
{
return useButtonRadius;
}
int ObjectSpawner::SetHoldObject(bool a)
{
holdObject = a;
return 0;
}
bool ObjectSpawner::GetHoldObject()
{
return holdObject;
}
int ObjectSpawner::SetTeamOnVehicle(bool a)
{
teamOnVehicle = a;
return 0;
}
bool ObjectSpawner::GetTeamOnVehicle()
{
return teamOnVehicle;
}