-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcolobot.hpp
343 lines (276 loc) · 8.08 KB
/
colobot.hpp
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
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
#include <string>
#ifdef __INTELLISENSE__
// occurs on using array in different way
// incomplete type is not allowed
#pragma diag_suppress 70
// occurs on using array in different way
// an array may not have elements of this type
#pragma diag_suppress 98
// occurs on using array in different way
// expression must be a modifiable lvalue
#pragma diag_suppress 137
// occurs on using array in different way
// variable "x" has an unitialized const or reference member
#pragma diag_suppress 369
// occurs on using array in different way
// initialization with '{...}' expected for aggregate object
#pragma diag_suppress 520
// occurs on assignment in while() parameter
// expression must have arithmaetic, unscoped enum, o pointer type but has type 'void'
#pragma diag_suppress 3362
#endif
#define Any 0
//might need any changes if needed
#define DisplayMessage 0
#define DisplayInfo 0
#define DisplayWarning 0
#define DisplayError 0
#define Houston 0
#define SpaceShip 0
#define BotFactory 0
#define ResearchCenter 0
#define RadarStation 0
#define ExchangePost 0
#define RepairCenter 0
#define DefenseTower 0
#define AutoLab 0
#define PowerStation 0
#define PowerPlant 0
#define NuclearPlant 0
#define Converter 0
#define Derrick 0
#define PowerCaptor 0
#define Vault 0
#define StartArea 0
#define GoalArea 0
#define Target1 0
#define AlienNest 0
#define TitaniumOre 0
#define UraniumOre 0
#define Titanium 0
#define PowerCell 0
#define NuclearCell 0
#define OrgaMatter 0
#define BlackBox 0
#define TNT 0
#define KeyA 0
#define KeyB 0
#define KeyC 0
#define KeyD 0
#define PracticeBot 0
#define TargetBot 0
#define WheeledGrabber 0
#define TrackedGrabber 0
#define WingedGrabber 0
#define LeggedGrabber 0
#define WheeledSniffer 0
#define TrackedSniffer 0
#define WingedSniffer 0
#define LeggedSniffer 0
#define WheeledShooter 0
#define TrackedShooter 0
#define WingedShooter 0
#define LeggedShooter 0
#define WheeledOrgaShooter 0
#define TrackedOrgaShooter 0
#define WingedOrgaShooter 0
#define LeggedOrgaShooter 0
#define WheeledBuilder 0
#define TrackedBuilder 0
#define WingedBuilder 0
#define LeggedBuilder 0
#define Subber 0
#define Recycler 0
#define Shielder 0
#define Thumper 0
#define PhazerShooter 0
#define AlienQueen 0
#define AlienEgg 0
#define AlienAnt 0
#define AlienSpider 0
#define AlienWasp 0
#define AlienWorm 0
#define Me 0
#define Mine 0
#define Barrier 0
#define Wreck 0
#define Ruin 0
#define Bush 0
#define GraviPlant 0
#define Crystal 0
#define BrownMushroom 0
#define GreenMushroom 0
#define BlueFlag 0
#define RedFlag 0
#define GreenFlag 0
#define YellowFlag 0
#define VioletFlag 0
#define WayPoint 0
#define Target2 0
#define PowerSpot 0
#define TitaniumSpot 0
#define UraniumSpot 0
#define ResearchTracked 0
#define ResearchWinged 0
#define ResearchShooter 0
#define ResearchDefenseTower 0
#define ResearchNuclearPlant 0
#define ResearchThumper 0
#define ResearchShielder 0
#define ResearchPhazerShooter 0
#define ResearchBuilder 0
#define ResearchTarget 0
#define ResearchLegged 0
#define ResearcgOrgaShooter 0
#define ResearchSniffer 0
#define ResearchSubber 0
#define ResearchRecycler 0
#define White 0
#define Black 0
#define Gray 0
#define LightGray 0
#define Red 0
#define Pink 0
#define Purple 0
#define Orange 0
#define Yellow 0
#define Beige 0
#define Brown 0
#define Skin 0
#define Green 0
#define LightGreen 0
#define Blue 0
#define LigthBlue 0
#define InFront 0
#define Behind 0
#define EnergyCell 0
namespace object{
struct point{
float x, y, z;
point(float xn = 0, float yn = 0, float zn = 0);
bool operator==(point p2);
};
class object{
public:
object();
void operator=(object o);
void operator=(object *o);
bool operator!=(object o);
bool operator!=(object *o);
bool operator==(object o);
bool operator==(object *o);
const int category, team;
const point position, velocity;
const object &energyCell, &load;
const float
orientation,
pitch,
roll,
energyLevel,
shieldLevel,
temperature,
altitude,
lifetime;
};
class file{
public:
void open(string str, string mode);
void close();
void writeln(string str);
string readln();
bool eof();
void deletefile(string filename);
};
typedef std::string string;
extern void main();
//template<typename t> std::string operator+(t t1, std::string s);
//template<typename t> std::string operator+(std::string s, t t1);
point position;
bool detect(int cat);
bool detect(int *cat);
//object radar(int cat, float angle = 0, float focus = 360, float min = 0, float max = 1000, float sens = 1, int filter = Any);
//object radar(int *cat, float angle = 0, float focus = 360, float min = 0, float max = 1000, float sens = 1, int filter = Any);
object radar(int cat, float angle = 0, float focus = 360, float min = 0, float max = 1000, float sens = 1, int filter[] = new int[1]{Any});
object radar(int *cat, float angle = 0, float focus = 360, float min = 0, float max = 1000, float sens = 1, int filter[] = new int[1]{Any});
//object *radarall(int cat, float angle = 0, float focus = 360, float min = 0, float max = 1000, float sens = 1, int filter = Any);
//object *radarall(int *cat, float angle = 0, float focus = 360, float min = 0, float max = 1000, float sens = 1, int filter = Any);
object *radarall(int cat, float angle = 0, float focus = 360, float min = 0, float max = 1000, float sens = 1, int filter[] = new int[1]{Any});
object *radarall(int *cat, float angle = 0, float focus = 360, float min = 0, float max = 1000, float sens = 1, int filter[] = new int[1]{Any});
object search(int cat, point position = position);
object search(int *cat, point position = position);
float direction(point pos);
float distance(point pos1, point pos2);
float distance2d(point pos1, point pos2);
void wait(float time);
int move(float length);
int turn(float angle);
int goto_(point position);
int goto_(point position, float altitude, int goal = 0);
void motor(float left, float right);
void jet(float power);
void message(string text, int type);
object retobject(int number);
void errmode(float mode = 1);
float abstime();
int pendown(int color = Black, float width = 0.5);
int penup();
int penwidth(float color);
int factory(int cat, string program, object factory);
int takeoff(object spaceship);
bool isbusy(object obj);
int research(int type, object researchCenter);
bool canresearch(int research);
bool researched(int research);
bool canbuild(int category);
bool buildingenabled(int category);
point space(point center, float rmin, float rmax, float dist);
point flatspace(point center, float flatmin, float rmin, float rmax, float dist);
float topo(point position);
float flatground(point center, float rmax);
int grab(int oper = InFront);
int drop(int oper = InFront);
int sniff();
int thump();
int recycle();
void shield(float oper, float radius);
int fire(float time);
int aim(float y, float x = 0);
int build(int category);
int flag(int color);
int deflag();
float receive(string name, float power = 10);
void send(string name, float value, float power = 10);
bool testinfo(string name, float power = 10);
void deleteinfo(string name, float power = 10);
int strlen(string str);
string strleft(string str, int len);
string strright(string str, int len);
string strmid(string str, int pos, int len);
int strfind(string str, string sub);
float strval(string str);
string strupper(string str);
string strlower(string str);
float rand();
float pow(float x, float y);
float sqrt(float val);
float floor(float val);
float ceil(float val);
float round(float val);
float trunc(float val);
float sin(float angle);
float cos(float angle);
float tan(float angle);
float asin(float val);
float acos(float val);
float atan(float val);
float atan2(float y, float x);
};
#define not !
#define goto goto_
#define extends :
#define super this
#define public
#define private
#define protected
#define synchronized
#define null NULL