1 /*
2 ** Lua binding: game
3 */
4
5 #include "tolua.h"
6
7 #ifndef __cplusplus
8 #include <stdlib.h>
9 #endif
10 #ifdef __cplusplus
11 extern "C" int tolua_bnd_takeownership (lua_State* L); // from tolua_map.c
12 #else
13 int tolua_bnd_takeownership (lua_State* L); /* from tolua_map.c */
14 #endif
15 #include <string.h>
16
17 /* Exported function */
18 TOLUA_API int tolua_game_open (lua_State* tolua_S);
19 LUALIB_API int luaopen_game (lua_State* tolua_S);
20
21 #ifdef HAVE_CONFIG_H
22 #include <fc_config.h>
23 #endif
24 #include "api_common_utilities.h"
25 #include "api_game_effects.h"
26 #include "api_game_find.h"
27 #include "api_game_methods.h"
28 #include "luascript_types.h"
29
30 /* function to register type */
tolua_reg_types(lua_State * tolua_S)31 static void tolua_reg_types (lua_State* tolua_S)
32 {
33 tolua_usertype(tolua_S,"Player");
34 tolua_usertype(tolua_S,"Terrain");
35 tolua_usertype(tolua_S,"Unit");
36 tolua_usertype(tolua_S,"Unit_List_Link");
37 tolua_usertype(tolua_S,"Achievement");
38 tolua_usertype(tolua_S,"Action");
39 tolua_usertype(tolua_S,"City_List_Link");
40 tolua_usertype(tolua_S,"Building_Type");
41 tolua_usertype(tolua_S,"Tech_Type");
42 tolua_usertype(tolua_S,"Unit_Type");
43 tolua_usertype(tolua_S,"City");
44 tolua_usertype(tolua_S,"Nation_Type");
45 tolua_usertype(tolua_S,"Government");
46 tolua_usertype(tolua_S,"Direction");
47 tolua_usertype(tolua_S,"Nonexistent");
48 tolua_usertype(tolua_S,"Connection");
49 tolua_usertype(tolua_S,"Disaster");
50 tolua_usertype(tolua_S,"Tile");
51 }
52
53 /* get function: name of class Player */
tolua_get_Player_Player_name(lua_State * tolua_S)54 static int tolua_get_Player_Player_name(lua_State* tolua_S)
55 {
56 Player* self = (Player*) tolua_tousertype(tolua_S,1,0);
57 #ifndef TOLUA_RELEASE
58 if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'name'",NULL);
59 #endif
60 tolua_pushstring(tolua_S,(const char*)self->name);
61 return 1;
62 }
63
64 /* get function: nation of class Player */
tolua_get_Player_Player_nation_ptr(lua_State * tolua_S)65 static int tolua_get_Player_Player_nation_ptr(lua_State* tolua_S)
66 {
67 Player* self = (Player*) tolua_tousertype(tolua_S,1,0);
68 #ifndef TOLUA_RELEASE
69 if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'nation'",NULL);
70 #endif
71 tolua_pushusertype(tolua_S,(void*)self->nation,"Nation_Type");
72 return 1;
73 }
74
75 /* set function: nation of class Player */
tolua_set_Player_Player_nation_ptr(lua_State * tolua_S)76 static int tolua_set_Player_Player_nation_ptr(lua_State* tolua_S)
77 {
78 Player* self = (Player*) tolua_tousertype(tolua_S,1,0);
79 #ifndef TOLUA_RELEASE
80 tolua_Error tolua_err;
81 if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'nation'",NULL);
82 if (!tolua_isusertype(tolua_S,2,"Nation_Type",0,&tolua_err))
83 tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err);
84 #endif
85 self->nation = ((Nation_Type*) tolua_tousertype(tolua_S,2,0));
86 return 0;
87 }
88
89 /* get function: ai_controlled of class Player */
tolua_get_Player_Player_ai_controlled(lua_State * tolua_S)90 static int tolua_get_Player_Player_ai_controlled(lua_State* tolua_S)
91 {
92 Player* self = (Player*) tolua_tousertype(tolua_S,1,0);
93 #ifndef TOLUA_RELEASE
94 if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'ai_controlled'",NULL);
95 #endif
96 tolua_pushboolean(tolua_S,(bool)self->ai_controlled);
97 return 1;
98 }
99
100 /* set function: ai_controlled of class Player */
tolua_set_Player_Player_ai_controlled(lua_State * tolua_S)101 static int tolua_set_Player_Player_ai_controlled(lua_State* tolua_S)
102 {
103 Player* self = (Player*) tolua_tousertype(tolua_S,1,0);
104 #ifndef TOLUA_RELEASE
105 tolua_Error tolua_err;
106 if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'ai_controlled'",NULL);
107 if (!tolua_isboolean(tolua_S,2,0,&tolua_err))
108 tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err);
109 #endif
110 self->ai_controlled = ((bool) tolua_toboolean(tolua_S,2,0));
111 return 0;
112 }
113
114 /* get function: is_alive of class Player */
tolua_get_Player_Player_is_alive(lua_State * tolua_S)115 static int tolua_get_Player_Player_is_alive(lua_State* tolua_S)
116 {
117 Player* self = (Player*) tolua_tousertype(tolua_S,1,0);
118 #ifndef TOLUA_RELEASE
119 if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'is_alive'",NULL);
120 #endif
121 tolua_pushboolean(tolua_S,(bool)self->is_alive);
122 return 1;
123 }
124
125 /* set function: is_alive of class Player */
tolua_set_Player_Player_is_alive(lua_State * tolua_S)126 static int tolua_set_Player_Player_is_alive(lua_State* tolua_S)
127 {
128 Player* self = (Player*) tolua_tousertype(tolua_S,1,0);
129 #ifndef TOLUA_RELEASE
130 tolua_Error tolua_err;
131 if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'is_alive'",NULL);
132 if (!tolua_isboolean(tolua_S,2,0,&tolua_err))
133 tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err);
134 #endif
135 self->is_alive = ((bool) tolua_toboolean(tolua_S,2,0));
136 return 0;
137 }
138
139 /* get function: name of class City */
tolua_get_City_City_name(lua_State * tolua_S)140 static int tolua_get_City_City_name(lua_State* tolua_S)
141 {
142 City* self = (City*) tolua_tousertype(tolua_S,1,0);
143 #ifndef TOLUA_RELEASE
144 if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'name'",NULL);
145 #endif
146 tolua_pushstring(tolua_S,(const char*)self->name);
147 return 1;
148 }
149
150 /* get function: owner of class City */
tolua_get_City_City_owner_ptr(lua_State * tolua_S)151 static int tolua_get_City_City_owner_ptr(lua_State* tolua_S)
152 {
153 City* self = (City*) tolua_tousertype(tolua_S,1,0);
154 #ifndef TOLUA_RELEASE
155 if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'owner'",NULL);
156 #endif
157 tolua_pushusertype(tolua_S,(void*)self->owner,"Player");
158 return 1;
159 }
160
161 /* set function: owner of class City */
tolua_set_City_City_owner_ptr(lua_State * tolua_S)162 static int tolua_set_City_City_owner_ptr(lua_State* tolua_S)
163 {
164 City* self = (City*) tolua_tousertype(tolua_S,1,0);
165 #ifndef TOLUA_RELEASE
166 tolua_Error tolua_err;
167 if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'owner'",NULL);
168 if (!tolua_isusertype(tolua_S,2,"Player",0,&tolua_err))
169 tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err);
170 #endif
171 self->owner = ((Player*) tolua_tousertype(tolua_S,2,0));
172 return 0;
173 }
174
175 /* get function: original of class City */
tolua_get_City_City_original_ptr(lua_State * tolua_S)176 static int tolua_get_City_City_original_ptr(lua_State* tolua_S)
177 {
178 City* self = (City*) tolua_tousertype(tolua_S,1,0);
179 #ifndef TOLUA_RELEASE
180 if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'original'",NULL);
181 #endif
182 tolua_pushusertype(tolua_S,(void*)self->original,"Player");
183 return 1;
184 }
185
186 /* set function: original of class City */
tolua_set_City_City_original_ptr(lua_State * tolua_S)187 static int tolua_set_City_City_original_ptr(lua_State* tolua_S)
188 {
189 City* self = (City*) tolua_tousertype(tolua_S,1,0);
190 #ifndef TOLUA_RELEASE
191 tolua_Error tolua_err;
192 if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'original'",NULL);
193 if (!tolua_isusertype(tolua_S,2,"Player",0,&tolua_err))
194 tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err);
195 #endif
196 self->original = ((Player*) tolua_tousertype(tolua_S,2,0));
197 return 0;
198 }
199
200 /* get function: id of class City */
tolua_get_City_City_id(lua_State * tolua_S)201 static int tolua_get_City_City_id(lua_State* tolua_S)
202 {
203 City* self = (City*) tolua_tousertype(tolua_S,1,0);
204 #ifndef TOLUA_RELEASE
205 if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'id'",NULL);
206 #endif
207 tolua_pushnumber(tolua_S,(lua_Number)self->id);
208 return 1;
209 }
210
211 /* get function: id of class Connection */
tolua_get_Connection_Connection_id(lua_State * tolua_S)212 static int tolua_get_Connection_Connection_id(lua_State* tolua_S)
213 {
214 Connection* self = (Connection*) tolua_tousertype(tolua_S,1,0);
215 #ifndef TOLUA_RELEASE
216 if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'id'",NULL);
217 #endif
218 tolua_pushnumber(tolua_S,(lua_Number)self->id);
219 return 1;
220 }
221
222 /* get function: utype of class Unit */
tolua_get_Unit_Unit_utype_ptr(lua_State * tolua_S)223 static int tolua_get_Unit_Unit_utype_ptr(lua_State* tolua_S)
224 {
225 Unit* self = (Unit*) tolua_tousertype(tolua_S,1,0);
226 #ifndef TOLUA_RELEASE
227 if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'utype'",NULL);
228 #endif
229 tolua_pushusertype(tolua_S,(void*)self->utype,"Unit_Type");
230 return 1;
231 }
232
233 /* set function: utype of class Unit */
tolua_set_Unit_Unit_utype_ptr(lua_State * tolua_S)234 static int tolua_set_Unit_Unit_utype_ptr(lua_State* tolua_S)
235 {
236 Unit* self = (Unit*) tolua_tousertype(tolua_S,1,0);
237 #ifndef TOLUA_RELEASE
238 tolua_Error tolua_err;
239 if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'utype'",NULL);
240 if (!tolua_isusertype(tolua_S,2,"Unit_Type",0,&tolua_err))
241 tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err);
242 #endif
243 self->utype = ((Unit_Type*) tolua_tousertype(tolua_S,2,0));
244 return 0;
245 }
246
247 /* get function: owner of class Unit */
tolua_get_Unit_Unit_owner_ptr(lua_State * tolua_S)248 static int tolua_get_Unit_Unit_owner_ptr(lua_State* tolua_S)
249 {
250 Unit* self = (Unit*) tolua_tousertype(tolua_S,1,0);
251 #ifndef TOLUA_RELEASE
252 if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'owner'",NULL);
253 #endif
254 tolua_pushusertype(tolua_S,(void*)self->owner,"Player");
255 return 1;
256 }
257
258 /* set function: owner of class Unit */
tolua_set_Unit_Unit_owner_ptr(lua_State * tolua_S)259 static int tolua_set_Unit_Unit_owner_ptr(lua_State* tolua_S)
260 {
261 Unit* self = (Unit*) tolua_tousertype(tolua_S,1,0);
262 #ifndef TOLUA_RELEASE
263 tolua_Error tolua_err;
264 if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'owner'",NULL);
265 if (!tolua_isusertype(tolua_S,2,"Player",0,&tolua_err))
266 tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err);
267 #endif
268 self->owner = ((Player*) tolua_tousertype(tolua_S,2,0));
269 return 0;
270 }
271
272 /* get function: homecity of class Unit */
tolua_get_Unit_Unit_homecity(lua_State * tolua_S)273 static int tolua_get_Unit_Unit_homecity(lua_State* tolua_S)
274 {
275 Unit* self = (Unit*) tolua_tousertype(tolua_S,1,0);
276 #ifndef TOLUA_RELEASE
277 if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'homecity'",NULL);
278 #endif
279 tolua_pushnumber(tolua_S,(lua_Number)self->homecity);
280 return 1;
281 }
282
283 /* set function: homecity of class Unit */
tolua_set_Unit_Unit_homecity(lua_State * tolua_S)284 static int tolua_set_Unit_Unit_homecity(lua_State* tolua_S)
285 {
286 Unit* self = (Unit*) tolua_tousertype(tolua_S,1,0);
287 #ifndef TOLUA_RELEASE
288 tolua_Error tolua_err;
289 if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'homecity'",NULL);
290 if (!tolua_isnumber(tolua_S,2,0,&tolua_err))
291 tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err);
292 #endif
293 self->homecity = ((int) tolua_tonumber(tolua_S,2,0));
294 return 0;
295 }
296
297 /* get function: id of class Unit */
tolua_get_Unit_Unit_id(lua_State * tolua_S)298 static int tolua_get_Unit_Unit_id(lua_State* tolua_S)
299 {
300 Unit* self = (Unit*) tolua_tousertype(tolua_S,1,0);
301 #ifndef TOLUA_RELEASE
302 if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'id'",NULL);
303 #endif
304 tolua_pushnumber(tolua_S,(lua_Number)self->id);
305 return 1;
306 }
307
308 /* get function: terrain of class Tile */
tolua_get_Tile_Tile_terrain_ptr(lua_State * tolua_S)309 static int tolua_get_Tile_Tile_terrain_ptr(lua_State* tolua_S)
310 {
311 Tile* self = (Tile*) tolua_tousertype(tolua_S,1,0);
312 #ifndef TOLUA_RELEASE
313 if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'terrain'",NULL);
314 #endif
315 tolua_pushusertype(tolua_S,(void*)self->terrain,"Terrain");
316 return 1;
317 }
318
319 /* set function: terrain of class Tile */
tolua_set_Tile_Tile_terrain_ptr(lua_State * tolua_S)320 static int tolua_set_Tile_Tile_terrain_ptr(lua_State* tolua_S)
321 {
322 Tile* self = (Tile*) tolua_tousertype(tolua_S,1,0);
323 #ifndef TOLUA_RELEASE
324 tolua_Error tolua_err;
325 if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'terrain'",NULL);
326 if (!tolua_isusertype(tolua_S,2,"Terrain",0,&tolua_err))
327 tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err);
328 #endif
329 self->terrain = ((Terrain*) tolua_tousertype(tolua_S,2,0));
330 return 0;
331 }
332
333 /* get function: index of class Tile */
tolua_get_Tile_Tile_index(lua_State * tolua_S)334 static int tolua_get_Tile_Tile_index(lua_State* tolua_S)
335 {
336 Tile* self = (Tile*) tolua_tousertype(tolua_S,1,0);
337 #ifndef TOLUA_RELEASE
338 if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'index'",NULL);
339 #endif
340 tolua_pushnumber(tolua_S,(lua_Number)self->index);
341 return 1;
342 }
343
344 /* get function: item_number of class Government */
tolua_get_Government_Government_item_number(lua_State * tolua_S)345 static int tolua_get_Government_Government_item_number(lua_State* tolua_S)
346 {
347 Government* self = (Government*) tolua_tousertype(tolua_S,1,0);
348 #ifndef TOLUA_RELEASE
349 if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'item_number'",NULL);
350 #endif
351 tolua_pushnumber(tolua_S,(lua_Number)self->item_number);
352 return 1;
353 }
354
355 /* get function: item_number of class Nation_Type */
tolua_get_Nation_Type_Nation_Type_item_number(lua_State * tolua_S)356 static int tolua_get_Nation_Type_Nation_Type_item_number(lua_State* tolua_S)
357 {
358 Nation_Type* self = (Nation_Type*) tolua_tousertype(tolua_S,1,0);
359 #ifndef TOLUA_RELEASE
360 if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'item_number'",NULL);
361 #endif
362 tolua_pushnumber(tolua_S,(lua_Number)self->item_number);
363 return 1;
364 }
365
366 /* get function: build_cost of class Building_Type */
tolua_get_Building_Type_Building_Type_build_cost(lua_State * tolua_S)367 static int tolua_get_Building_Type_Building_Type_build_cost(lua_State* tolua_S)
368 {
369 Building_Type* self = (Building_Type*) tolua_tousertype(tolua_S,1,0);
370 #ifndef TOLUA_RELEASE
371 if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'build_cost'",NULL);
372 #endif
373 tolua_pushnumber(tolua_S,(lua_Number)self->build_cost);
374 return 1;
375 }
376
377 /* set function: build_cost of class Building_Type */
tolua_set_Building_Type_Building_Type_build_cost(lua_State * tolua_S)378 static int tolua_set_Building_Type_Building_Type_build_cost(lua_State* tolua_S)
379 {
380 Building_Type* self = (Building_Type*) tolua_tousertype(tolua_S,1,0);
381 #ifndef TOLUA_RELEASE
382 tolua_Error tolua_err;
383 if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'build_cost'",NULL);
384 if (!tolua_isnumber(tolua_S,2,0,&tolua_err))
385 tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err);
386 #endif
387 self->build_cost = ((int) tolua_tonumber(tolua_S,2,0));
388 return 0;
389 }
390
391 /* get function: item_number of class Building_Type */
tolua_get_Building_Type_Building_Type_item_number(lua_State * tolua_S)392 static int tolua_get_Building_Type_Building_Type_item_number(lua_State* tolua_S)
393 {
394 Building_Type* self = (Building_Type*) tolua_tousertype(tolua_S,1,0);
395 #ifndef TOLUA_RELEASE
396 if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'item_number'",NULL);
397 #endif
398 tolua_pushnumber(tolua_S,(lua_Number)self->item_number);
399 return 1;
400 }
401
402 /* get function: build_cost of class Unit_Type */
tolua_get_Unit_Type_Unit_Type_build_cost(lua_State * tolua_S)403 static int tolua_get_Unit_Type_Unit_Type_build_cost(lua_State* tolua_S)
404 {
405 Unit_Type* self = (Unit_Type*) tolua_tousertype(tolua_S,1,0);
406 #ifndef TOLUA_RELEASE
407 if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'build_cost'",NULL);
408 #endif
409 tolua_pushnumber(tolua_S,(lua_Number)self->build_cost);
410 return 1;
411 }
412
413 /* set function: build_cost of class Unit_Type */
tolua_set_Unit_Type_Unit_Type_build_cost(lua_State * tolua_S)414 static int tolua_set_Unit_Type_Unit_Type_build_cost(lua_State* tolua_S)
415 {
416 Unit_Type* self = (Unit_Type*) tolua_tousertype(tolua_S,1,0);
417 #ifndef TOLUA_RELEASE
418 tolua_Error tolua_err;
419 if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'build_cost'",NULL);
420 if (!tolua_isnumber(tolua_S,2,0,&tolua_err))
421 tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err);
422 #endif
423 self->build_cost = ((int) tolua_tonumber(tolua_S,2,0));
424 return 0;
425 }
426
427 /* get function: item_number of class Unit_Type */
tolua_get_Unit_Type_Unit_Type_item_number(lua_State * tolua_S)428 static int tolua_get_Unit_Type_Unit_Type_item_number(lua_State* tolua_S)
429 {
430 Unit_Type* self = (Unit_Type*) tolua_tousertype(tolua_S,1,0);
431 #ifndef TOLUA_RELEASE
432 if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'item_number'",NULL);
433 #endif
434 tolua_pushnumber(tolua_S,(lua_Number)self->item_number);
435 return 1;
436 }
437
438 /* get function: item_number of class Tech_Type */
tolua_get_Tech_Type_Tech_Type_item_number(lua_State * tolua_S)439 static int tolua_get_Tech_Type_Tech_Type_item_number(lua_State* tolua_S)
440 {
441 Tech_Type* self = (Tech_Type*) tolua_tousertype(tolua_S,1,0);
442 #ifndef TOLUA_RELEASE
443 if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'item_number'",NULL);
444 #endif
445 tolua_pushnumber(tolua_S,(lua_Number)self->item_number);
446 return 1;
447 }
448
449 /* get function: item_number of class Terrain */
tolua_get_Terrain_Terrain_item_number(lua_State * tolua_S)450 static int tolua_get_Terrain_Terrain_item_number(lua_State* tolua_S)
451 {
452 Terrain* self = (Terrain*) tolua_tousertype(tolua_S,1,0);
453 #ifndef TOLUA_RELEASE
454 if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'item_number'",NULL);
455 #endif
456 tolua_pushnumber(tolua_S,(lua_Number)self->item_number);
457 return 1;
458 }
459
460 /* get function: id of class Disaster */
tolua_get_Disaster_Disaster_id(lua_State * tolua_S)461 static int tolua_get_Disaster_Disaster_id(lua_State* tolua_S)
462 {
463 Disaster* self = (Disaster*) tolua_tousertype(tolua_S,1,0);
464 #ifndef TOLUA_RELEASE
465 if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'id'",NULL);
466 #endif
467 tolua_pushnumber(tolua_S,(lua_Number)self->id);
468 return 1;
469 }
470
471 /* get function: id of class Achievement */
tolua_get_Achievement_Achievement_id(lua_State * tolua_S)472 static int tolua_get_Achievement_Achievement_id(lua_State* tolua_S)
473 {
474 Achievement* self = (Achievement*) tolua_tousertype(tolua_S,1,0);
475 #ifndef TOLUA_RELEASE
476 if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'id'",NULL);
477 #endif
478 tolua_pushnumber(tolua_S,(lua_Number)self->id);
479 return 1;
480 }
481
482 /* get function: id of class Action */
tolua_get_Action_Action_id(lua_State * tolua_S)483 static int tolua_get_Action_Action_id(lua_State* tolua_S)
484 {
485 Action* self = (Action*) tolua_tousertype(tolua_S,1,0);
486 #ifndef TOLUA_RELEASE
487 if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'id'",NULL);
488 #endif
489 tolua_pushnumber(tolua_S,(lua_Number)self->id);
490 return 1;
491 }
492
493 /* function: api_methods_game_turn */
tolua_game_game_turn00(lua_State * tolua_S)494 static int tolua_game_game_turn00(lua_State* tolua_S)
495 {
496 #ifndef TOLUA_RELEASE
497 tolua_Error tolua_err;
498 if (
499 !tolua_isnoobj(tolua_S,1,&tolua_err)
500 )
501 goto tolua_lerror;
502 else
503 #endif
504 {
505 lua_State* L = tolua_S;
506 {
507 int tolua_ret = (int) api_methods_game_turn(L);
508 tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
509 }
510 }
511 return 1;
512 #ifndef TOLUA_RELEASE
513 tolua_lerror:
514 tolua_error(tolua_S,"#ferror in function 'turn'.",&tolua_err);
515 return 0;
516 #endif
517 }
518
519 /* function: api_methods_player_number */
tolua_game_Player_properties_id00(lua_State * tolua_S)520 static int tolua_game_Player_properties_id00(lua_State* tolua_S)
521 {
522 #ifndef TOLUA_RELEASE
523 tolua_Error tolua_err;
524 if (
525 !tolua_isusertype(tolua_S,1,"Player",0,&tolua_err) ||
526 !tolua_isnoobj(tolua_S,2,&tolua_err)
527 )
528 goto tolua_lerror;
529 else
530 #endif
531 {
532 lua_State* L = tolua_S;
533 Player* self = ((Player*) tolua_tousertype(tolua_S,1,0));
534 {
535 int tolua_ret = (int) api_methods_player_number(L,self);
536 tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
537 }
538 }
539 return 1;
540 #ifndef TOLUA_RELEASE
541 tolua_lerror:
542 tolua_error(tolua_S,"#ferror in function 'id'.",&tolua_err);
543 return 0;
544 #endif
545 }
546
547 /* function: api_methods_player_num_cities */
tolua_game_Player_num_cities00(lua_State * tolua_S)548 static int tolua_game_Player_num_cities00(lua_State* tolua_S)
549 {
550 #ifndef TOLUA_RELEASE
551 tolua_Error tolua_err;
552 if (
553 !tolua_isusertype(tolua_S,1,"Player",0,&tolua_err) ||
554 !tolua_isnoobj(tolua_S,2,&tolua_err)
555 )
556 goto tolua_lerror;
557 else
558 #endif
559 {
560 lua_State* L = tolua_S;
561 Player* self = ((Player*) tolua_tousertype(tolua_S,1,0));
562 {
563 int tolua_ret = (int) api_methods_player_num_cities(L,self);
564 tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
565 }
566 }
567 return 1;
568 #ifndef TOLUA_RELEASE
569 tolua_lerror:
570 tolua_error(tolua_S,"#ferror in function 'num_cities'.",&tolua_err);
571 return 0;
572 #endif
573 }
574
575 /* function: api_methods_player_num_units */
tolua_game_Player_num_units00(lua_State * tolua_S)576 static int tolua_game_Player_num_units00(lua_State* tolua_S)
577 {
578 #ifndef TOLUA_RELEASE
579 tolua_Error tolua_err;
580 if (
581 !tolua_isusertype(tolua_S,1,"Player",0,&tolua_err) ||
582 !tolua_isnoobj(tolua_S,2,&tolua_err)
583 )
584 goto tolua_lerror;
585 else
586 #endif
587 {
588 lua_State* L = tolua_S;
589 Player* self = ((Player*) tolua_tousertype(tolua_S,1,0));
590 {
591 int tolua_ret = (int) api_methods_player_num_units(L,self);
592 tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
593 }
594 }
595 return 1;
596 #ifndef TOLUA_RELEASE
597 tolua_lerror:
598 tolua_error(tolua_S,"#ferror in function 'num_units'.",&tolua_err);
599 return 0;
600 #endif
601 }
602
603 /* function: api_methods_player_has_wonder */
tolua_game_Player_has_wonder00(lua_State * tolua_S)604 static int tolua_game_Player_has_wonder00(lua_State* tolua_S)
605 {
606 #ifndef TOLUA_RELEASE
607 tolua_Error tolua_err;
608 if (
609 !tolua_isusertype(tolua_S,1,"Player",0,&tolua_err) ||
610 !tolua_isusertype(tolua_S,2,"Building_Type",0,&tolua_err) ||
611 !tolua_isnoobj(tolua_S,3,&tolua_err)
612 )
613 goto tolua_lerror;
614 else
615 #endif
616 {
617 lua_State* L = tolua_S;
618 Player* self = ((Player*) tolua_tousertype(tolua_S,1,0));
619 Building_Type* building = ((Building_Type*) tolua_tousertype(tolua_S,2,0));
620 {
621 bool tolua_ret = (bool) api_methods_player_has_wonder(L,self,building);
622 tolua_pushboolean(tolua_S,(bool)tolua_ret);
623 }
624 }
625 return 1;
626 #ifndef TOLUA_RELEASE
627 tolua_lerror:
628 tolua_error(tolua_S,"#ferror in function 'has_wonder'.",&tolua_err);
629 return 0;
630 #endif
631 }
632
633 /* function: api_methods_player_gold */
tolua_game_Player_gold00(lua_State * tolua_S)634 static int tolua_game_Player_gold00(lua_State* tolua_S)
635 {
636 #ifndef TOLUA_RELEASE
637 tolua_Error tolua_err;
638 if (
639 !tolua_isusertype(tolua_S,1,"Player",0,&tolua_err) ||
640 !tolua_isnoobj(tolua_S,2,&tolua_err)
641 )
642 goto tolua_lerror;
643 else
644 #endif
645 {
646 lua_State* L = tolua_S;
647 Player* self = ((Player*) tolua_tousertype(tolua_S,1,0));
648 {
649 int tolua_ret = (int) api_methods_player_gold(L,self);
650 tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
651 }
652 }
653 return 1;
654 #ifndef TOLUA_RELEASE
655 tolua_lerror:
656 tolua_error(tolua_S,"#ferror in function 'gold'.",&tolua_err);
657 return 0;
658 #endif
659 }
660
661 /* function: api_methods_player_knows_tech */
tolua_game_Player_knows_tech00(lua_State * tolua_S)662 static int tolua_game_Player_knows_tech00(lua_State* tolua_S)
663 {
664 #ifndef TOLUA_RELEASE
665 tolua_Error tolua_err;
666 if (
667 !tolua_isusertype(tolua_S,1,"Player",0,&tolua_err) ||
668 !tolua_isusertype(tolua_S,2,"Tech_Type",0,&tolua_err) ||
669 !tolua_isnoobj(tolua_S,3,&tolua_err)
670 )
671 goto tolua_lerror;
672 else
673 #endif
674 {
675 lua_State* L = tolua_S;
676 Player* self = ((Player*) tolua_tousertype(tolua_S,1,0));
677 Tech_Type* ptech = ((Tech_Type*) tolua_tousertype(tolua_S,2,0));
678 {
679 bool tolua_ret = (bool) api_methods_player_knows_tech(L,self,ptech);
680 tolua_pushboolean(tolua_S,(bool)tolua_ret);
681 }
682 }
683 return 1;
684 #ifndef TOLUA_RELEASE
685 tolua_lerror:
686 tolua_error(tolua_S,"#ferror in function 'knows_tech'.",&tolua_err);
687 return 0;
688 #endif
689 }
690
691 /* function: api_methods_player_shares_research */
tolua_game_Player_shares_research00(lua_State * tolua_S)692 static int tolua_game_Player_shares_research00(lua_State* tolua_S)
693 {
694 #ifndef TOLUA_RELEASE
695 tolua_Error tolua_err;
696 if (
697 !tolua_isusertype(tolua_S,1,"Player",0,&tolua_err) ||
698 !tolua_isusertype(tolua_S,2,"Player",0,&tolua_err) ||
699 !tolua_isnoobj(tolua_S,3,&tolua_err)
700 )
701 goto tolua_lerror;
702 else
703 #endif
704 {
705 lua_State* L = tolua_S;
706 Player* self = ((Player*) tolua_tousertype(tolua_S,1,0));
707 Player* other = ((Player*) tolua_tousertype(tolua_S,2,0));
708 {
709 bool tolua_ret = (bool) api_methods_player_shares_research(L,self,other);
710 tolua_pushboolean(tolua_S,(bool)tolua_ret);
711 }
712 }
713 return 1;
714 #ifndef TOLUA_RELEASE
715 tolua_lerror:
716 tolua_error(tolua_S,"#ferror in function 'shares_research'.",&tolua_err);
717 return 0;
718 #endif
719 }
720
721 /* function: api_methods_research_rule_name */
tolua_game_Player_research_rule_name00(lua_State * tolua_S)722 static int tolua_game_Player_research_rule_name00(lua_State* tolua_S)
723 {
724 #ifndef TOLUA_RELEASE
725 tolua_Error tolua_err;
726 if (
727 !tolua_isusertype(tolua_S,1,"Player",0,&tolua_err) ||
728 !tolua_isnoobj(tolua_S,2,&tolua_err)
729 )
730 goto tolua_lerror;
731 else
732 #endif
733 {
734 lua_State* L = tolua_S;
735 Player* self = ((Player*) tolua_tousertype(tolua_S,1,0));
736 {
737 const char* tolua_ret = (const char*) api_methods_research_rule_name(L,self);
738 tolua_pushstring(tolua_S,(const char*)tolua_ret);
739 }
740 }
741 return 1;
742 #ifndef TOLUA_RELEASE
743 tolua_lerror:
744 tolua_error(tolua_S,"#ferror in function 'research_rule_name'.",&tolua_err);
745 return 0;
746 #endif
747 }
748
749 /* function: api_methods_research_name_translation */
tolua_game_Player_research_name_translation00(lua_State * tolua_S)750 static int tolua_game_Player_research_name_translation00(lua_State* tolua_S)
751 {
752 #ifndef TOLUA_RELEASE
753 tolua_Error tolua_err;
754 if (
755 !tolua_isusertype(tolua_S,1,"Player",0,&tolua_err) ||
756 !tolua_isnoobj(tolua_S,2,&tolua_err)
757 )
758 goto tolua_lerror;
759 else
760 #endif
761 {
762 lua_State* L = tolua_S;
763 Player* self = ((Player*) tolua_tousertype(tolua_S,1,0));
764 {
765 const char* tolua_ret = (const char*) api_methods_research_name_translation(L,self);
766 tolua_pushstring(tolua_S,(const char*)tolua_ret);
767 }
768 }
769 return 1;
770 #ifndef TOLUA_RELEASE
771 tolua_lerror:
772 tolua_error(tolua_S,"#ferror in function 'research_name_translation'.",&tolua_err);
773 return 0;
774 #endif
775 }
776
777 /* function: api_methods_player_culture_get */
tolua_game_Player_culture00(lua_State * tolua_S)778 static int tolua_game_Player_culture00(lua_State* tolua_S)
779 {
780 #ifndef TOLUA_RELEASE
781 tolua_Error tolua_err;
782 if (
783 !tolua_isusertype(tolua_S,1,"Player",0,&tolua_err) ||
784 !tolua_isnoobj(tolua_S,2,&tolua_err)
785 )
786 goto tolua_lerror;
787 else
788 #endif
789 {
790 lua_State* L = tolua_S;
791 Player* self = ((Player*) tolua_tousertype(tolua_S,1,0));
792 {
793 int tolua_ret = (int) api_methods_player_culture_get(L,self);
794 tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
795 }
796 }
797 return 1;
798 #ifndef TOLUA_RELEASE
799 tolua_lerror:
800 tolua_error(tolua_S,"#ferror in function 'culture'.",&tolua_err);
801 return 0;
802 #endif
803 }
804
805 /* function: api_methods_private_list_players */
tolua_game_methods_private_list_players00(lua_State * tolua_S)806 static int tolua_game_methods_private_list_players00(lua_State* tolua_S)
807 {
808 #ifndef TOLUA_RELEASE
809 tolua_Error tolua_err;
810 if (
811 !tolua_isnoobj(tolua_S,1,&tolua_err)
812 )
813 goto tolua_lerror;
814 else
815 #endif
816 {
817 lua_State* L = tolua_S;
818 {
819 lua_Object tolua_ret = (lua_Object) api_methods_private_list_players(L);
820 tolua_pushvalue(tolua_S,(int)tolua_ret);
821 }
822 }
823 return 1;
824 #ifndef TOLUA_RELEASE
825 tolua_lerror:
826 tolua_error(tolua_S,"#ferror in function 'list_players'.",&tolua_err);
827 return 0;
828 #endif
829 }
830
831 /* function: api_methods_private_player_unit_list_head */
tolua_game_methods_private_Player_unit_list_head00(lua_State * tolua_S)832 static int tolua_game_methods_private_Player_unit_list_head00(lua_State* tolua_S)
833 {
834 #ifndef TOLUA_RELEASE
835 tolua_Error tolua_err;
836 if (
837 !tolua_isusertype(tolua_S,1,"Player",0,&tolua_err) ||
838 !tolua_isnoobj(tolua_S,2,&tolua_err)
839 )
840 goto tolua_lerror;
841 else
842 #endif
843 {
844 lua_State* L = tolua_S;
845 Player* self = ((Player*) tolua_tousertype(tolua_S,1,0));
846 {
847 Unit_List_Link* tolua_ret = (Unit_List_Link*) api_methods_private_player_unit_list_head(L,self);
848 tolua_pushusertype(tolua_S,(void*)tolua_ret,"Unit_List_Link");
849 }
850 }
851 return 1;
852 #ifndef TOLUA_RELEASE
853 tolua_lerror:
854 tolua_error(tolua_S,"#ferror in function 'unit_list_head'.",&tolua_err);
855 return 0;
856 #endif
857 }
858
859 /* function: api_methods_private_player_city_list_head */
tolua_game_methods_private_Player_city_list_head00(lua_State * tolua_S)860 static int tolua_game_methods_private_Player_city_list_head00(lua_State* tolua_S)
861 {
862 #ifndef TOLUA_RELEASE
863 tolua_Error tolua_err;
864 if (
865 !tolua_isusertype(tolua_S,1,"Player",0,&tolua_err) ||
866 !tolua_isnoobj(tolua_S,2,&tolua_err)
867 )
868 goto tolua_lerror;
869 else
870 #endif
871 {
872 lua_State* L = tolua_S;
873 Player* self = ((Player*) tolua_tousertype(tolua_S,1,0));
874 {
875 City_List_Link* tolua_ret = (City_List_Link*) api_methods_private_player_city_list_head(L,self);
876 tolua_pushusertype(tolua_S,(void*)tolua_ret,"City_List_Link");
877 }
878 }
879 return 1;
880 #ifndef TOLUA_RELEASE
881 tolua_lerror:
882 tolua_error(tolua_S,"#ferror in function 'city_list_head'.",&tolua_err);
883 return 0;
884 #endif
885 }
886
887 /* function: api_methods_city_size_get */
tolua_game_City_properties_size00(lua_State * tolua_S)888 static int tolua_game_City_properties_size00(lua_State* tolua_S)
889 {
890 #ifndef TOLUA_RELEASE
891 tolua_Error tolua_err;
892 if (
893 !tolua_isusertype(tolua_S,1,"City",0,&tolua_err) ||
894 !tolua_isnoobj(tolua_S,2,&tolua_err)
895 )
896 goto tolua_lerror;
897 else
898 #endif
899 {
900 lua_State* L = tolua_S;
901 City* self = ((City*) tolua_tousertype(tolua_S,1,0));
902 {
903 int tolua_ret = (int) api_methods_city_size_get(L,self);
904 tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
905 }
906 }
907 return 1;
908 #ifndef TOLUA_RELEASE
909 tolua_lerror:
910 tolua_error(tolua_S,"#ferror in function 'size'.",&tolua_err);
911 return 0;
912 #endif
913 }
914
915 /* function: api_methods_city_tile_get */
tolua_game_City_properties_tile00(lua_State * tolua_S)916 static int tolua_game_City_properties_tile00(lua_State* tolua_S)
917 {
918 #ifndef TOLUA_RELEASE
919 tolua_Error tolua_err;
920 if (
921 !tolua_isusertype(tolua_S,1,"City",0,&tolua_err) ||
922 !tolua_isnoobj(tolua_S,2,&tolua_err)
923 )
924 goto tolua_lerror;
925 else
926 #endif
927 {
928 lua_State* L = tolua_S;
929 City* self = ((City*) tolua_tousertype(tolua_S,1,0));
930 {
931 Tile* tolua_ret = (Tile*) api_methods_city_tile_get(L,self);
932 tolua_pushusertype(tolua_S,(void*)tolua_ret,"Tile");
933 }
934 }
935 return 1;
936 #ifndef TOLUA_RELEASE
937 tolua_lerror:
938 tolua_error(tolua_S,"#ferror in function 'tile'.",&tolua_err);
939 return 0;
940 #endif
941 }
942
943 /* function: api_methods_city_has_building */
tolua_game_City_has_building00(lua_State * tolua_S)944 static int tolua_game_City_has_building00(lua_State* tolua_S)
945 {
946 #ifndef TOLUA_RELEASE
947 tolua_Error tolua_err;
948 if (
949 !tolua_isusertype(tolua_S,1,"City",0,&tolua_err) ||
950 !tolua_isusertype(tolua_S,2,"Building_Type",0,&tolua_err) ||
951 !tolua_isnoobj(tolua_S,3,&tolua_err)
952 )
953 goto tolua_lerror;
954 else
955 #endif
956 {
957 lua_State* L = tolua_S;
958 City* self = ((City*) tolua_tousertype(tolua_S,1,0));
959 Building_Type* building = ((Building_Type*) tolua_tousertype(tolua_S,2,0));
960 {
961 bool tolua_ret = (bool) api_methods_city_has_building(L,self,building);
962 tolua_pushboolean(tolua_S,(bool)tolua_ret);
963 }
964 }
965 return 1;
966 #ifndef TOLUA_RELEASE
967 tolua_lerror:
968 tolua_error(tolua_S,"#ferror in function 'has_building'.",&tolua_err);
969 return 0;
970 #endif
971 }
972
973 /* function: api_methods_city_map_sq_radius */
tolua_game_City_map_sq_radius00(lua_State * tolua_S)974 static int tolua_game_City_map_sq_radius00(lua_State* tolua_S)
975 {
976 #ifndef TOLUA_RELEASE
977 tolua_Error tolua_err;
978 if (
979 !tolua_isusertype(tolua_S,1,"City",0,&tolua_err) ||
980 !tolua_isnoobj(tolua_S,2,&tolua_err)
981 )
982 goto tolua_lerror;
983 else
984 #endif
985 {
986 lua_State* L = tolua_S;
987 City* self = ((City*) tolua_tousertype(tolua_S,1,0));
988 {
989 int tolua_ret = (int) api_methods_city_map_sq_radius(L,self);
990 tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
991 }
992 }
993 return 1;
994 #ifndef TOLUA_RELEASE
995 tolua_lerror:
996 tolua_error(tolua_S,"#ferror in function 'map_sq_radius'.",&tolua_err);
997 return 0;
998 #endif
999 }
1000
1001 /* function: api_methods_city_inspire_partisans */
tolua_game_City_inspire_partisans00(lua_State * tolua_S)1002 static int tolua_game_City_inspire_partisans00(lua_State* tolua_S)
1003 {
1004 #ifndef TOLUA_RELEASE
1005 tolua_Error tolua_err;
1006 if (
1007 !tolua_isusertype(tolua_S,1,"City",0,&tolua_err) ||
1008 !tolua_isusertype(tolua_S,2,"Player",0,&tolua_err) ||
1009 !tolua_isnoobj(tolua_S,3,&tolua_err)
1010 )
1011 goto tolua_lerror;
1012 else
1013 #endif
1014 {
1015 lua_State* L = tolua_S;
1016 City* self = ((City*) tolua_tousertype(tolua_S,1,0));
1017 Player* inspirer = ((Player*) tolua_tousertype(tolua_S,2,0));
1018 {
1019 int tolua_ret = (int) api_methods_city_inspire_partisans(L,self,inspirer);
1020 tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
1021 }
1022 }
1023 return 1;
1024 #ifndef TOLUA_RELEASE
1025 tolua_lerror:
1026 tolua_error(tolua_S,"#ferror in function 'inspire_partisans'.",&tolua_err);
1027 return 0;
1028 #endif
1029 }
1030
1031 /* function: api_methods_city_culture_get */
tolua_game_City_culture00(lua_State * tolua_S)1032 static int tolua_game_City_culture00(lua_State* tolua_S)
1033 {
1034 #ifndef TOLUA_RELEASE
1035 tolua_Error tolua_err;
1036 if (
1037 !tolua_isusertype(tolua_S,1,"City",0,&tolua_err) ||
1038 !tolua_isnoobj(tolua_S,2,&tolua_err)
1039 )
1040 goto tolua_lerror;
1041 else
1042 #endif
1043 {
1044 lua_State* L = tolua_S;
1045 City* self = ((City*) tolua_tousertype(tolua_S,1,0));
1046 {
1047 int tolua_ret = (int) api_methods_city_culture_get(L,self);
1048 tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
1049 }
1050 }
1051 return 1;
1052 #ifndef TOLUA_RELEASE
1053 tolua_lerror:
1054 tolua_error(tolua_S,"#ferror in function 'culture'.",&tolua_err);
1055 return 0;
1056 #endif
1057 }
1058
1059 /* function: api_methods_is_city_happy */
tolua_game_City_is_happy00(lua_State * tolua_S)1060 static int tolua_game_City_is_happy00(lua_State* tolua_S)
1061 {
1062 #ifndef TOLUA_RELEASE
1063 tolua_Error tolua_err;
1064 if (
1065 !tolua_isusertype(tolua_S,1,"City",0,&tolua_err) ||
1066 !tolua_isnoobj(tolua_S,2,&tolua_err)
1067 )
1068 goto tolua_lerror;
1069 else
1070 #endif
1071 {
1072 lua_State* L = tolua_S;
1073 City* self = ((City*) tolua_tousertype(tolua_S,1,0));
1074 {
1075 bool tolua_ret = (bool) api_methods_is_city_happy(L,self);
1076 tolua_pushboolean(tolua_S,(bool)tolua_ret);
1077 }
1078 }
1079 return 1;
1080 #ifndef TOLUA_RELEASE
1081 tolua_lerror:
1082 tolua_error(tolua_S,"#ferror in function 'is_happy'.",&tolua_err);
1083 return 0;
1084 #endif
1085 }
1086
1087 /* function: api_methods_is_city_unhappy */
tolua_game_City_is_unhappy00(lua_State * tolua_S)1088 static int tolua_game_City_is_unhappy00(lua_State* tolua_S)
1089 {
1090 #ifndef TOLUA_RELEASE
1091 tolua_Error tolua_err;
1092 if (
1093 !tolua_isusertype(tolua_S,1,"City",0,&tolua_err) ||
1094 !tolua_isnoobj(tolua_S,2,&tolua_err)
1095 )
1096 goto tolua_lerror;
1097 else
1098 #endif
1099 {
1100 lua_State* L = tolua_S;
1101 City* self = ((City*) tolua_tousertype(tolua_S,1,0));
1102 {
1103 bool tolua_ret = (bool) api_methods_is_city_unhappy(L,self);
1104 tolua_pushboolean(tolua_S,(bool)tolua_ret);
1105 }
1106 }
1107 return 1;
1108 #ifndef TOLUA_RELEASE
1109 tolua_lerror:
1110 tolua_error(tolua_S,"#ferror in function 'is_unhappy'.",&tolua_err);
1111 return 0;
1112 #endif
1113 }
1114
1115 /* function: api_methods_is_city_celebrating */
tolua_game_City_is_celebrating00(lua_State * tolua_S)1116 static int tolua_game_City_is_celebrating00(lua_State* tolua_S)
1117 {
1118 #ifndef TOLUA_RELEASE
1119 tolua_Error tolua_err;
1120 if (
1121 !tolua_isusertype(tolua_S,1,"City",0,&tolua_err) ||
1122 !tolua_isnoobj(tolua_S,2,&tolua_err)
1123 )
1124 goto tolua_lerror;
1125 else
1126 #endif
1127 {
1128 lua_State* L = tolua_S;
1129 City* self = ((City*) tolua_tousertype(tolua_S,1,0));
1130 {
1131 bool tolua_ret = (bool) api_methods_is_city_celebrating(L,self);
1132 tolua_pushboolean(tolua_S,(bool)tolua_ret);
1133 }
1134 }
1135 return 1;
1136 #ifndef TOLUA_RELEASE
1137 tolua_lerror:
1138 tolua_error(tolua_S,"#ferror in function 'is_celebrating'.",&tolua_err);
1139 return 0;
1140 #endif
1141 }
1142
1143 /* function: api_methods_is_gov_center */
tolua_game_City_is_gov_center00(lua_State * tolua_S)1144 static int tolua_game_City_is_gov_center00(lua_State* tolua_S)
1145 {
1146 #ifndef TOLUA_RELEASE
1147 tolua_Error tolua_err;
1148 if (
1149 !tolua_isusertype(tolua_S,1,"City",0,&tolua_err) ||
1150 !tolua_isnoobj(tolua_S,2,&tolua_err)
1151 )
1152 goto tolua_lerror;
1153 else
1154 #endif
1155 {
1156 lua_State* L = tolua_S;
1157 City* self = ((City*) tolua_tousertype(tolua_S,1,0));
1158 {
1159 bool tolua_ret = (bool) api_methods_is_gov_center(L,self);
1160 tolua_pushboolean(tolua_S,(bool)tolua_ret);
1161 }
1162 }
1163 return 1;
1164 #ifndef TOLUA_RELEASE
1165 tolua_lerror:
1166 tolua_error(tolua_S,"#ferror in function 'is_gov_center'.",&tolua_err);
1167 return 0;
1168 #endif
1169 }
1170
1171 /* function: api_methods_is_capital */
tolua_game_City_is_capital00(lua_State * tolua_S)1172 static int tolua_game_City_is_capital00(lua_State* tolua_S)
1173 {
1174 #ifndef TOLUA_RELEASE
1175 tolua_Error tolua_err;
1176 if (
1177 !tolua_isusertype(tolua_S,1,"City",0,&tolua_err) ||
1178 !tolua_isnoobj(tolua_S,2,&tolua_err)
1179 )
1180 goto tolua_lerror;
1181 else
1182 #endif
1183 {
1184 lua_State* L = tolua_S;
1185 City* self = ((City*) tolua_tousertype(tolua_S,1,0));
1186 {
1187 bool tolua_ret = (bool) api_methods_is_capital(L,self);
1188 tolua_pushboolean(tolua_S,(bool)tolua_ret);
1189 }
1190 }
1191 return 1;
1192 #ifndef TOLUA_RELEASE
1193 tolua_lerror:
1194 tolua_error(tolua_S,"#ferror in function 'is_capital'.",&tolua_err);
1195 return 0;
1196 #endif
1197 }
1198
1199 /* function: api_methods_unit_tile_get */
tolua_game_Unit_properties_tile00(lua_State * tolua_S)1200 static int tolua_game_Unit_properties_tile00(lua_State* tolua_S)
1201 {
1202 #ifndef TOLUA_RELEASE
1203 tolua_Error tolua_err;
1204 if (
1205 !tolua_isusertype(tolua_S,1,"Unit",0,&tolua_err) ||
1206 !tolua_isnoobj(tolua_S,2,&tolua_err)
1207 )
1208 goto tolua_lerror;
1209 else
1210 #endif
1211 {
1212 lua_State* L = tolua_S;
1213 Unit* self = ((Unit*) tolua_tousertype(tolua_S,1,0));
1214 {
1215 Tile* tolua_ret = (Tile*) api_methods_unit_tile_get(L,self);
1216 tolua_pushusertype(tolua_S,(void*)tolua_ret,"Tile");
1217 }
1218 }
1219 return 1;
1220 #ifndef TOLUA_RELEASE
1221 tolua_lerror:
1222 tolua_error(tolua_S,"#ferror in function 'tile'.",&tolua_err);
1223 return 0;
1224 #endif
1225 }
1226
1227 /* function: api_methods_unit_transporter */
tolua_game_Unit_transporter00(lua_State * tolua_S)1228 static int tolua_game_Unit_transporter00(lua_State* tolua_S)
1229 {
1230 #ifndef TOLUA_RELEASE
1231 tolua_Error tolua_err;
1232 if (
1233 !tolua_isusertype(tolua_S,1,"Unit",0,&tolua_err) ||
1234 !tolua_isnoobj(tolua_S,2,&tolua_err)
1235 )
1236 goto tolua_lerror;
1237 else
1238 #endif
1239 {
1240 lua_State* L = tolua_S;
1241 Unit* self = ((Unit*) tolua_tousertype(tolua_S,1,0));
1242 {
1243 Unit* tolua_ret = (Unit*) api_methods_unit_transporter(L,self);
1244 tolua_pushusertype(tolua_S,(void*)tolua_ret,"Unit");
1245 }
1246 }
1247 return 1;
1248 #ifndef TOLUA_RELEASE
1249 tolua_lerror:
1250 tolua_error(tolua_S,"#ferror in function 'transporter'.",&tolua_err);
1251 return 0;
1252 #endif
1253 }
1254
1255 /* function: api_methods_unit_city_can_be_built_here */
tolua_game_Unit_is_on_possible_city_tile00(lua_State * tolua_S)1256 static int tolua_game_Unit_is_on_possible_city_tile00(lua_State* tolua_S)
1257 {
1258 #ifndef TOLUA_RELEASE
1259 tolua_Error tolua_err;
1260 if (
1261 !tolua_isusertype(tolua_S,1,"Unit",0,&tolua_err) ||
1262 !tolua_isnoobj(tolua_S,2,&tolua_err)
1263 )
1264 goto tolua_lerror;
1265 else
1266 #endif
1267 {
1268 lua_State* L = tolua_S;
1269 Unit* self = ((Unit*) tolua_tousertype(tolua_S,1,0));
1270 {
1271 bool tolua_ret = (bool) api_methods_unit_city_can_be_built_here(L,self);
1272 tolua_pushboolean(tolua_S,(bool)tolua_ret);
1273 }
1274 }
1275 return 1;
1276 #ifndef TOLUA_RELEASE
1277 tolua_lerror:
1278 tolua_error(tolua_S,"#ferror in function 'is_on_possible_city_tile'.",&tolua_err);
1279 return 0;
1280 #endif
1281 }
1282
1283 /* function: api_methods_unit_orientation_get */
tolua_game_Unit_facing00(lua_State * tolua_S)1284 static int tolua_game_Unit_facing00(lua_State* tolua_S)
1285 {
1286 #ifndef TOLUA_RELEASE
1287 tolua_Error tolua_err;
1288 if (
1289 !tolua_isusertype(tolua_S,1,"Unit",0,&tolua_err) ||
1290 !tolua_isnoobj(tolua_S,2,&tolua_err)
1291 )
1292 goto tolua_lerror;
1293 else
1294 #endif
1295 {
1296 lua_State* L = tolua_S;
1297 Unit* self = ((Unit*) tolua_tousertype(tolua_S,1,0));
1298 {
1299 Direction* tolua_ret = (Direction*) api_methods_unit_orientation_get(L,self);
1300 tolua_pushusertype(tolua_S,(void*)tolua_ret,"Direction");
1301 }
1302 }
1303 return 1;
1304 #ifndef TOLUA_RELEASE
1305 tolua_lerror:
1306 tolua_error(tolua_S,"#ferror in function 'facing'.",&tolua_err);
1307 return 0;
1308 #endif
1309 }
1310
1311 /* function: api_methods_private_unit_cargo_list_head */
tolua_game_methods_private_Unit_cargo_list_head00(lua_State * tolua_S)1312 static int tolua_game_methods_private_Unit_cargo_list_head00(lua_State* tolua_S)
1313 {
1314 #ifndef TOLUA_RELEASE
1315 tolua_Error tolua_err;
1316 if (
1317 !tolua_isusertype(tolua_S,1,"Unit",0,&tolua_err) ||
1318 !tolua_isnoobj(tolua_S,2,&tolua_err)
1319 )
1320 goto tolua_lerror;
1321 else
1322 #endif
1323 {
1324 lua_State* L = tolua_S;
1325 Unit* self = ((Unit*) tolua_tousertype(tolua_S,1,0));
1326 {
1327 Unit_List_Link* tolua_ret = (Unit_List_Link*) api_methods_private_unit_cargo_list_head(L,self);
1328 tolua_pushusertype(tolua_S,(void*)tolua_ret,"Unit_List_Link");
1329 }
1330 }
1331 return 1;
1332 #ifndef TOLUA_RELEASE
1333 tolua_lerror:
1334 tolua_error(tolua_S,"#ferror in function 'cargo_list_head'.",&tolua_err);
1335 return 0;
1336 #endif
1337 }
1338
1339 /* function: api_methods_tile_nat_x */
tolua_game_Tile_properties_nat_x00(lua_State * tolua_S)1340 static int tolua_game_Tile_properties_nat_x00(lua_State* tolua_S)
1341 {
1342 #ifndef TOLUA_RELEASE
1343 tolua_Error tolua_err;
1344 if (
1345 !tolua_isusertype(tolua_S,1,"Tile",0,&tolua_err) ||
1346 !tolua_isnoobj(tolua_S,2,&tolua_err)
1347 )
1348 goto tolua_lerror;
1349 else
1350 #endif
1351 {
1352 lua_State* L = tolua_S;
1353 Tile* self = ((Tile*) tolua_tousertype(tolua_S,1,0));
1354 {
1355 int tolua_ret = (int) api_methods_tile_nat_x(L,self);
1356 tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
1357 }
1358 }
1359 return 1;
1360 #ifndef TOLUA_RELEASE
1361 tolua_lerror:
1362 tolua_error(tolua_S,"#ferror in function 'nat_x'.",&tolua_err);
1363 return 0;
1364 #endif
1365 }
1366
1367 /* function: api_methods_tile_nat_y */
tolua_game_Tile_properties_nat_y00(lua_State * tolua_S)1368 static int tolua_game_Tile_properties_nat_y00(lua_State* tolua_S)
1369 {
1370 #ifndef TOLUA_RELEASE
1371 tolua_Error tolua_err;
1372 if (
1373 !tolua_isusertype(tolua_S,1,"Tile",0,&tolua_err) ||
1374 !tolua_isnoobj(tolua_S,2,&tolua_err)
1375 )
1376 goto tolua_lerror;
1377 else
1378 #endif
1379 {
1380 lua_State* L = tolua_S;
1381 Tile* self = ((Tile*) tolua_tousertype(tolua_S,1,0));
1382 {
1383 int tolua_ret = (int) api_methods_tile_nat_y(L,self);
1384 tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
1385 }
1386 }
1387 return 1;
1388 #ifndef TOLUA_RELEASE
1389 tolua_lerror:
1390 tolua_error(tolua_S,"#ferror in function 'nat_y'.",&tolua_err);
1391 return 0;
1392 #endif
1393 }
1394
1395 /* function: api_methods_tile_map_x */
tolua_game_Tile_properties_x00(lua_State * tolua_S)1396 static int tolua_game_Tile_properties_x00(lua_State* tolua_S)
1397 {
1398 #ifndef TOLUA_RELEASE
1399 tolua_Error tolua_err;
1400 if (
1401 !tolua_isusertype(tolua_S,1,"Tile",0,&tolua_err) ||
1402 !tolua_isnoobj(tolua_S,2,&tolua_err)
1403 )
1404 goto tolua_lerror;
1405 else
1406 #endif
1407 {
1408 lua_State* L = tolua_S;
1409 Tile* self = ((Tile*) tolua_tousertype(tolua_S,1,0));
1410 {
1411 int tolua_ret = (int) api_methods_tile_map_x(L,self);
1412 tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
1413 }
1414 }
1415 return 1;
1416 #ifndef TOLUA_RELEASE
1417 tolua_lerror:
1418 tolua_error(tolua_S,"#ferror in function 'x'.",&tolua_err);
1419 return 0;
1420 #endif
1421 }
1422
1423 /* function: api_methods_tile_map_y */
tolua_game_Tile_properties_y00(lua_State * tolua_S)1424 static int tolua_game_Tile_properties_y00(lua_State* tolua_S)
1425 {
1426 #ifndef TOLUA_RELEASE
1427 tolua_Error tolua_err;
1428 if (
1429 !tolua_isusertype(tolua_S,1,"Tile",0,&tolua_err) ||
1430 !tolua_isnoobj(tolua_S,2,&tolua_err)
1431 )
1432 goto tolua_lerror;
1433 else
1434 #endif
1435 {
1436 lua_State* L = tolua_S;
1437 Tile* self = ((Tile*) tolua_tousertype(tolua_S,1,0));
1438 {
1439 int tolua_ret = (int) api_methods_tile_map_y(L,self);
1440 tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
1441 }
1442 }
1443 return 1;
1444 #ifndef TOLUA_RELEASE
1445 tolua_lerror:
1446 tolua_error(tolua_S,"#ferror in function 'y'.",&tolua_err);
1447 return 0;
1448 #endif
1449 }
1450
1451 /* function: api_methods_tile_city */
tolua_game_Tile_city00(lua_State * tolua_S)1452 static int tolua_game_Tile_city00(lua_State* tolua_S)
1453 {
1454 #ifndef TOLUA_RELEASE
1455 tolua_Error tolua_err;
1456 if (
1457 !tolua_isusertype(tolua_S,1,"Tile",0,&tolua_err) ||
1458 !tolua_isnoobj(tolua_S,2,&tolua_err)
1459 )
1460 goto tolua_lerror;
1461 else
1462 #endif
1463 {
1464 lua_State* L = tolua_S;
1465 Tile* self = ((Tile*) tolua_tousertype(tolua_S,1,0));
1466 {
1467 City* tolua_ret = (City*) api_methods_tile_city(L,self);
1468 tolua_pushusertype(tolua_S,(void*)tolua_ret,"City");
1469 }
1470 }
1471 return 1;
1472 #ifndef TOLUA_RELEASE
1473 tolua_lerror:
1474 tolua_error(tolua_S,"#ferror in function 'city'.",&tolua_err);
1475 return 0;
1476 #endif
1477 }
1478
1479 /* function: api_methods_tile_city_exists_within_max_city_map */
tolua_game_Tile_city_exists_within_max_city_map00(lua_State * tolua_S)1480 static int tolua_game_Tile_city_exists_within_max_city_map00(lua_State* tolua_S)
1481 {
1482 #ifndef TOLUA_RELEASE
1483 tolua_Error tolua_err;
1484 if (
1485 !tolua_isusertype(tolua_S,1,"Tile",0,&tolua_err) ||
1486 !tolua_isboolean(tolua_S,2,0,&tolua_err) ||
1487 !tolua_isnoobj(tolua_S,3,&tolua_err)
1488 )
1489 goto tolua_lerror;
1490 else
1491 #endif
1492 {
1493 lua_State* L = tolua_S;
1494 Tile* self = ((Tile*) tolua_tousertype(tolua_S,1,0));
1495 bool center = ((bool) tolua_toboolean(tolua_S,2,0));
1496 {
1497 bool tolua_ret = (bool) api_methods_tile_city_exists_within_max_city_map(L,self,center);
1498 tolua_pushboolean(tolua_S,(bool)tolua_ret);
1499 }
1500 }
1501 return 1;
1502 #ifndef TOLUA_RELEASE
1503 tolua_lerror:
1504 tolua_error(tolua_S,"#ferror in function 'city_exists_within_max_city_map'.",&tolua_err);
1505 return 0;
1506 #endif
1507 }
1508
1509 /* function: api_methods_tile_has_extra */
tolua_game_Tile_has_extra00(lua_State * tolua_S)1510 static int tolua_game_Tile_has_extra00(lua_State* tolua_S)
1511 {
1512 #ifndef TOLUA_RELEASE
1513 tolua_Error tolua_err;
1514 if (
1515 !tolua_isusertype(tolua_S,1,"Tile",0,&tolua_err) ||
1516 !tolua_isstring(tolua_S,2,0,&tolua_err) ||
1517 !tolua_isnoobj(tolua_S,3,&tolua_err)
1518 )
1519 goto tolua_lerror;
1520 else
1521 #endif
1522 {
1523 lua_State* L = tolua_S;
1524 Tile* self = ((Tile*) tolua_tousertype(tolua_S,1,0));
1525 const char* name = ((const char*) tolua_tostring(tolua_S,2,0));
1526 {
1527 bool tolua_ret = (bool) api_methods_tile_has_extra(L,self,name);
1528 tolua_pushboolean(tolua_S,(bool)tolua_ret);
1529 }
1530 }
1531 return 1;
1532 #ifndef TOLUA_RELEASE
1533 tolua_lerror:
1534 tolua_error(tolua_S,"#ferror in function 'has_extra'.",&tolua_err);
1535 return 0;
1536 #endif
1537 }
1538
1539 /* function: api_methods_tile_has_base */
tolua_game_Tile_has_base00(lua_State * tolua_S)1540 static int tolua_game_Tile_has_base00(lua_State* tolua_S)
1541 {
1542 #ifndef TOLUA_RELEASE
1543 tolua_Error tolua_err;
1544 if (
1545 !tolua_isusertype(tolua_S,1,"Tile",0,&tolua_err) ||
1546 !tolua_isstring(tolua_S,2,0,&tolua_err) ||
1547 !tolua_isnoobj(tolua_S,3,&tolua_err)
1548 )
1549 goto tolua_lerror;
1550 else
1551 #endif
1552 {
1553 lua_State* L = tolua_S;
1554 Tile* self = ((Tile*) tolua_tousertype(tolua_S,1,0));
1555 const char* name = ((const char*) tolua_tostring(tolua_S,2,0));
1556 {
1557 bool tolua_ret = (bool) api_methods_tile_has_base(L,self,name);
1558 tolua_pushboolean(tolua_S,(bool)tolua_ret);
1559 }
1560 }
1561 return 1;
1562 #ifndef TOLUA_RELEASE
1563 tolua_lerror:
1564 tolua_error(tolua_S,"#ferror in function 'has_base'.",&tolua_err);
1565 return 0;
1566 #endif
1567 }
1568
1569 /* function: api_methods_tile_has_road */
tolua_game_Tile_has_road00(lua_State * tolua_S)1570 static int tolua_game_Tile_has_road00(lua_State* tolua_S)
1571 {
1572 #ifndef TOLUA_RELEASE
1573 tolua_Error tolua_err;
1574 if (
1575 !tolua_isusertype(tolua_S,1,"Tile",0,&tolua_err) ||
1576 !tolua_isstring(tolua_S,2,0,&tolua_err) ||
1577 !tolua_isnoobj(tolua_S,3,&tolua_err)
1578 )
1579 goto tolua_lerror;
1580 else
1581 #endif
1582 {
1583 lua_State* L = tolua_S;
1584 Tile* self = ((Tile*) tolua_tousertype(tolua_S,1,0));
1585 const char* name = ((const char*) tolua_tostring(tolua_S,2,0));
1586 {
1587 bool tolua_ret = (bool) api_methods_tile_has_road(L,self,name);
1588 tolua_pushboolean(tolua_S,(bool)tolua_ret);
1589 }
1590 }
1591 return 1;
1592 #ifndef TOLUA_RELEASE
1593 tolua_lerror:
1594 tolua_error(tolua_S,"#ferror in function 'has_road'.",&tolua_err);
1595 return 0;
1596 #endif
1597 }
1598
1599 /* function: api_methods_tile_num_units */
tolua_game_Tile_num_units00(lua_State * tolua_S)1600 static int tolua_game_Tile_num_units00(lua_State* tolua_S)
1601 {
1602 #ifndef TOLUA_RELEASE
1603 tolua_Error tolua_err;
1604 if (
1605 !tolua_isusertype(tolua_S,1,"Tile",0,&tolua_err) ||
1606 !tolua_isnoobj(tolua_S,2,&tolua_err)
1607 )
1608 goto tolua_lerror;
1609 else
1610 #endif
1611 {
1612 lua_State* L = tolua_S;
1613 Tile* self = ((Tile*) tolua_tousertype(tolua_S,1,0));
1614 {
1615 int tolua_ret = (int) api_methods_tile_num_units(L,self);
1616 tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
1617 }
1618 }
1619 return 1;
1620 #ifndef TOLUA_RELEASE
1621 tolua_lerror:
1622 tolua_error(tolua_S,"#ferror in function 'num_units'.",&tolua_err);
1623 return 0;
1624 #endif
1625 }
1626
1627 /* function: api_methods_tile_sq_distance */
tolua_game_Tile_sq_distance00(lua_State * tolua_S)1628 static int tolua_game_Tile_sq_distance00(lua_State* tolua_S)
1629 {
1630 #ifndef TOLUA_RELEASE
1631 tolua_Error tolua_err;
1632 if (
1633 !tolua_isusertype(tolua_S,1,"Tile",0,&tolua_err) ||
1634 !tolua_isusertype(tolua_S,2,"Tile",0,&tolua_err) ||
1635 !tolua_isnoobj(tolua_S,3,&tolua_err)
1636 )
1637 goto tolua_lerror;
1638 else
1639 #endif
1640 {
1641 lua_State* L = tolua_S;
1642 Tile* self = ((Tile*) tolua_tousertype(tolua_S,1,0));
1643 Tile* other = ((Tile*) tolua_tousertype(tolua_S,2,0));
1644 {
1645 int tolua_ret = (int) api_methods_tile_sq_distance(L,self,other);
1646 tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
1647 }
1648 }
1649 return 1;
1650 #ifndef TOLUA_RELEASE
1651 tolua_lerror:
1652 tolua_error(tolua_S,"#ferror in function 'sq_distance'.",&tolua_err);
1653 return 0;
1654 #endif
1655 }
1656
1657 /* function: api_methods_private_tile_next_outward_index */
tolua_game_methods_private_Tile_next_outward_index00(lua_State * tolua_S)1658 static int tolua_game_methods_private_Tile_next_outward_index00(lua_State* tolua_S)
1659 {
1660 #ifndef TOLUA_RELEASE
1661 tolua_Error tolua_err;
1662 if (
1663 !tolua_isusertype(tolua_S,1,"Tile",0,&tolua_err) ||
1664 !tolua_isnumber(tolua_S,2,0,&tolua_err) ||
1665 !tolua_isnumber(tolua_S,3,0,&tolua_err) ||
1666 !tolua_isnoobj(tolua_S,4,&tolua_err)
1667 )
1668 goto tolua_lerror;
1669 else
1670 #endif
1671 {
1672 lua_State* L = tolua_S;
1673 Tile* pcenter = ((Tile*) tolua_tousertype(tolua_S,1,0));
1674 int tindex = ((int) tolua_tonumber(tolua_S,2,0));
1675 int max_dist = ((int) tolua_tonumber(tolua_S,3,0));
1676 {
1677 int tolua_ret = (int) api_methods_private_tile_next_outward_index(L,pcenter,tindex,max_dist);
1678 tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
1679 }
1680 }
1681 return 1;
1682 #ifndef TOLUA_RELEASE
1683 tolua_lerror:
1684 tolua_error(tolua_S,"#ferror in function 'next_outward_index'.",&tolua_err);
1685 return 0;
1686 #endif
1687 }
1688
1689 /* function: api_methods_private_tile_for_outward_index */
tolua_game_methods_private_Tile_tile_for_outward_index00(lua_State * tolua_S)1690 static int tolua_game_methods_private_Tile_tile_for_outward_index00(lua_State* tolua_S)
1691 {
1692 #ifndef TOLUA_RELEASE
1693 tolua_Error tolua_err;
1694 if (
1695 !tolua_isusertype(tolua_S,1,"Tile",0,&tolua_err) ||
1696 !tolua_isnumber(tolua_S,2,0,&tolua_err) ||
1697 !tolua_isnoobj(tolua_S,3,&tolua_err)
1698 )
1699 goto tolua_lerror;
1700 else
1701 #endif
1702 {
1703 lua_State* L = tolua_S;
1704 Tile* pcenter = ((Tile*) tolua_tousertype(tolua_S,1,0));
1705 int tindex = ((int) tolua_tonumber(tolua_S,2,0));
1706 {
1707 Tile* tolua_ret = (Tile*) api_methods_private_tile_for_outward_index(L,pcenter,tindex);
1708 tolua_pushusertype(tolua_S,(void*)tolua_ret,"Tile");
1709 }
1710 }
1711 return 1;
1712 #ifndef TOLUA_RELEASE
1713 tolua_lerror:
1714 tolua_error(tolua_S,"#ferror in function 'tile_for_outward_index'.",&tolua_err);
1715 return 0;
1716 #endif
1717 }
1718
1719 /* function: api_methods_private_tile_unit_list_head */
tolua_game_methods_private_Tile_unit_list_head00(lua_State * tolua_S)1720 static int tolua_game_methods_private_Tile_unit_list_head00(lua_State* tolua_S)
1721 {
1722 #ifndef TOLUA_RELEASE
1723 tolua_Error tolua_err;
1724 if (
1725 !tolua_isusertype(tolua_S,1,"Tile",0,&tolua_err) ||
1726 !tolua_isnoobj(tolua_S,2,&tolua_err)
1727 )
1728 goto tolua_lerror;
1729 else
1730 #endif
1731 {
1732 lua_State* L = tolua_S;
1733 Tile* self = ((Tile*) tolua_tousertype(tolua_S,1,0));
1734 {
1735 Unit_List_Link* tolua_ret = (Unit_List_Link*) api_methods_private_tile_unit_list_head(L,self);
1736 tolua_pushusertype(tolua_S,(void*)tolua_ret,"Unit_List_Link");
1737 }
1738 }
1739 return 1;
1740 #ifndef TOLUA_RELEASE
1741 tolua_lerror:
1742 tolua_error(tolua_S,"#ferror in function 'unit_list_head'.",&tolua_err);
1743 return 0;
1744 #endif
1745 }
1746
1747 /* function: api_methods_government_rule_name */
tolua_game_Government_rule_name00(lua_State * tolua_S)1748 static int tolua_game_Government_rule_name00(lua_State* tolua_S)
1749 {
1750 #ifndef TOLUA_RELEASE
1751 tolua_Error tolua_err;
1752 if (
1753 !tolua_isusertype(tolua_S,1,"Government",0,&tolua_err) ||
1754 !tolua_isnoobj(tolua_S,2,&tolua_err)
1755 )
1756 goto tolua_lerror;
1757 else
1758 #endif
1759 {
1760 lua_State* L = tolua_S;
1761 Government* self = ((Government*) tolua_tousertype(tolua_S,1,0));
1762 {
1763 const char* tolua_ret = (const char*) api_methods_government_rule_name(L,self);
1764 tolua_pushstring(tolua_S,(const char*)tolua_ret);
1765 }
1766 }
1767 return 1;
1768 #ifndef TOLUA_RELEASE
1769 tolua_lerror:
1770 tolua_error(tolua_S,"#ferror in function 'rule_name'.",&tolua_err);
1771 return 0;
1772 #endif
1773 }
1774
1775 /* function: api_methods_government_name_translation */
tolua_game_Government_name_translation00(lua_State * tolua_S)1776 static int tolua_game_Government_name_translation00(lua_State* tolua_S)
1777 {
1778 #ifndef TOLUA_RELEASE
1779 tolua_Error tolua_err;
1780 if (
1781 !tolua_isusertype(tolua_S,1,"Government",0,&tolua_err) ||
1782 !tolua_isnoobj(tolua_S,2,&tolua_err)
1783 )
1784 goto tolua_lerror;
1785 else
1786 #endif
1787 {
1788 lua_State* L = tolua_S;
1789 Government* self = ((Government*) tolua_tousertype(tolua_S,1,0));
1790 {
1791 const char* tolua_ret = (const char*) api_methods_government_name_translation(L,self);
1792 tolua_pushstring(tolua_S,(const char*)tolua_ret);
1793 }
1794 }
1795 return 1;
1796 #ifndef TOLUA_RELEASE
1797 tolua_lerror:
1798 tolua_error(tolua_S,"#ferror in function 'name_translation'.",&tolua_err);
1799 return 0;
1800 #endif
1801 }
1802
1803 /* function: api_methods_nation_type_rule_name */
tolua_game_Nation_Type_rule_name00(lua_State * tolua_S)1804 static int tolua_game_Nation_Type_rule_name00(lua_State* tolua_S)
1805 {
1806 #ifndef TOLUA_RELEASE
1807 tolua_Error tolua_err;
1808 if (
1809 !tolua_isusertype(tolua_S,1,"Nation_Type",0,&tolua_err) ||
1810 !tolua_isnoobj(tolua_S,2,&tolua_err)
1811 )
1812 goto tolua_lerror;
1813 else
1814 #endif
1815 {
1816 lua_State* L = tolua_S;
1817 Nation_Type* self = ((Nation_Type*) tolua_tousertype(tolua_S,1,0));
1818 {
1819 const char* tolua_ret = (const char*) api_methods_nation_type_rule_name(L,self);
1820 tolua_pushstring(tolua_S,(const char*)tolua_ret);
1821 }
1822 }
1823 return 1;
1824 #ifndef TOLUA_RELEASE
1825 tolua_lerror:
1826 tolua_error(tolua_S,"#ferror in function 'rule_name'.",&tolua_err);
1827 return 0;
1828 #endif
1829 }
1830
1831 /* function: api_methods_nation_type_name_translation */
tolua_game_Nation_Type_name_translation00(lua_State * tolua_S)1832 static int tolua_game_Nation_Type_name_translation00(lua_State* tolua_S)
1833 {
1834 #ifndef TOLUA_RELEASE
1835 tolua_Error tolua_err;
1836 if (
1837 !tolua_isusertype(tolua_S,1,"Nation_Type",0,&tolua_err) ||
1838 !tolua_isnoobj(tolua_S,2,&tolua_err)
1839 )
1840 goto tolua_lerror;
1841 else
1842 #endif
1843 {
1844 lua_State* L = tolua_S;
1845 Nation_Type* self = ((Nation_Type*) tolua_tousertype(tolua_S,1,0));
1846 {
1847 const char* tolua_ret = (const char*) api_methods_nation_type_name_translation(L,self);
1848 tolua_pushstring(tolua_S,(const char*)tolua_ret);
1849 }
1850 }
1851 return 1;
1852 #ifndef TOLUA_RELEASE
1853 tolua_lerror:
1854 tolua_error(tolua_S,"#ferror in function 'name_translation'.",&tolua_err);
1855 return 0;
1856 #endif
1857 }
1858
1859 /* function: api_methods_nation_type_plural_translation */
tolua_game_Nation_Type_plural_translation00(lua_State * tolua_S)1860 static int tolua_game_Nation_Type_plural_translation00(lua_State* tolua_S)
1861 {
1862 #ifndef TOLUA_RELEASE
1863 tolua_Error tolua_err;
1864 if (
1865 !tolua_isusertype(tolua_S,1,"Nation_Type",0,&tolua_err) ||
1866 !tolua_isnoobj(tolua_S,2,&tolua_err)
1867 )
1868 goto tolua_lerror;
1869 else
1870 #endif
1871 {
1872 lua_State* L = tolua_S;
1873 Nation_Type* self = ((Nation_Type*) tolua_tousertype(tolua_S,1,0));
1874 {
1875 const char* tolua_ret = (const char*) api_methods_nation_type_plural_translation(L,self);
1876 tolua_pushstring(tolua_S,(const char*)tolua_ret);
1877 }
1878 }
1879 return 1;
1880 #ifndef TOLUA_RELEASE
1881 tolua_lerror:
1882 tolua_error(tolua_S,"#ferror in function 'plural_translation'.",&tolua_err);
1883 return 0;
1884 #endif
1885 }
1886
1887 /* function: api_methods_building_type_is_wonder */
tolua_game_Building_Type_is_wonder00(lua_State * tolua_S)1888 static int tolua_game_Building_Type_is_wonder00(lua_State* tolua_S)
1889 {
1890 #ifndef TOLUA_RELEASE
1891 tolua_Error tolua_err;
1892 if (
1893 !tolua_isusertype(tolua_S,1,"Building_Type",0,&tolua_err) ||
1894 !tolua_isnoobj(tolua_S,2,&tolua_err)
1895 )
1896 goto tolua_lerror;
1897 else
1898 #endif
1899 {
1900 lua_State* L = tolua_S;
1901 Building_Type* self = ((Building_Type*) tolua_tousertype(tolua_S,1,0));
1902 {
1903 bool tolua_ret = (bool) api_methods_building_type_is_wonder(L,self);
1904 tolua_pushboolean(tolua_S,(bool)tolua_ret);
1905 }
1906 }
1907 return 1;
1908 #ifndef TOLUA_RELEASE
1909 tolua_lerror:
1910 tolua_error(tolua_S,"#ferror in function 'is_wonder'.",&tolua_err);
1911 return 0;
1912 #endif
1913 }
1914
1915 /* function: api_methods_building_type_is_great_wonder */
tolua_game_Building_Type_is_great_wonder00(lua_State * tolua_S)1916 static int tolua_game_Building_Type_is_great_wonder00(lua_State* tolua_S)
1917 {
1918 #ifndef TOLUA_RELEASE
1919 tolua_Error tolua_err;
1920 if (
1921 !tolua_isusertype(tolua_S,1,"Building_Type",0,&tolua_err) ||
1922 !tolua_isnoobj(tolua_S,2,&tolua_err)
1923 )
1924 goto tolua_lerror;
1925 else
1926 #endif
1927 {
1928 lua_State* L = tolua_S;
1929 Building_Type* self = ((Building_Type*) tolua_tousertype(tolua_S,1,0));
1930 {
1931 bool tolua_ret = (bool) api_methods_building_type_is_great_wonder(L,self);
1932 tolua_pushboolean(tolua_S,(bool)tolua_ret);
1933 }
1934 }
1935 return 1;
1936 #ifndef TOLUA_RELEASE
1937 tolua_lerror:
1938 tolua_error(tolua_S,"#ferror in function 'is_great_wonder'.",&tolua_err);
1939 return 0;
1940 #endif
1941 }
1942
1943 /* function: api_methods_building_type_is_small_wonder */
tolua_game_Building_Type_is_small_wonder00(lua_State * tolua_S)1944 static int tolua_game_Building_Type_is_small_wonder00(lua_State* tolua_S)
1945 {
1946 #ifndef TOLUA_RELEASE
1947 tolua_Error tolua_err;
1948 if (
1949 !tolua_isusertype(tolua_S,1,"Building_Type",0,&tolua_err) ||
1950 !tolua_isnoobj(tolua_S,2,&tolua_err)
1951 )
1952 goto tolua_lerror;
1953 else
1954 #endif
1955 {
1956 lua_State* L = tolua_S;
1957 Building_Type* self = ((Building_Type*) tolua_tousertype(tolua_S,1,0));
1958 {
1959 bool tolua_ret = (bool) api_methods_building_type_is_small_wonder(L,self);
1960 tolua_pushboolean(tolua_S,(bool)tolua_ret);
1961 }
1962 }
1963 return 1;
1964 #ifndef TOLUA_RELEASE
1965 tolua_lerror:
1966 tolua_error(tolua_S,"#ferror in function 'is_small_wonder'.",&tolua_err);
1967 return 0;
1968 #endif
1969 }
1970
1971 /* function: api_methods_building_type_is_improvement */
tolua_game_Building_Type_is_improvement00(lua_State * tolua_S)1972 static int tolua_game_Building_Type_is_improvement00(lua_State* tolua_S)
1973 {
1974 #ifndef TOLUA_RELEASE
1975 tolua_Error tolua_err;
1976 if (
1977 !tolua_isusertype(tolua_S,1,"Building_Type",0,&tolua_err) ||
1978 !tolua_isnoobj(tolua_S,2,&tolua_err)
1979 )
1980 goto tolua_lerror;
1981 else
1982 #endif
1983 {
1984 lua_State* L = tolua_S;
1985 Building_Type* self = ((Building_Type*) tolua_tousertype(tolua_S,1,0));
1986 {
1987 bool tolua_ret = (bool) api_methods_building_type_is_improvement(L,self);
1988 tolua_pushboolean(tolua_S,(bool)tolua_ret);
1989 }
1990 }
1991 return 1;
1992 #ifndef TOLUA_RELEASE
1993 tolua_lerror:
1994 tolua_error(tolua_S,"#ferror in function 'is_improvement'.",&tolua_err);
1995 return 0;
1996 #endif
1997 }
1998
1999 /* function: api_methods_building_type_rule_name */
tolua_game_Building_Type_rule_name00(lua_State * tolua_S)2000 static int tolua_game_Building_Type_rule_name00(lua_State* tolua_S)
2001 {
2002 #ifndef TOLUA_RELEASE
2003 tolua_Error tolua_err;
2004 if (
2005 !tolua_isusertype(tolua_S,1,"Building_Type",0,&tolua_err) ||
2006 !tolua_isnoobj(tolua_S,2,&tolua_err)
2007 )
2008 goto tolua_lerror;
2009 else
2010 #endif
2011 {
2012 lua_State* L = tolua_S;
2013 Building_Type* self = ((Building_Type*) tolua_tousertype(tolua_S,1,0));
2014 {
2015 const char* tolua_ret = (const char*) api_methods_building_type_rule_name(L,self);
2016 tolua_pushstring(tolua_S,(const char*)tolua_ret);
2017 }
2018 }
2019 return 1;
2020 #ifndef TOLUA_RELEASE
2021 tolua_lerror:
2022 tolua_error(tolua_S,"#ferror in function 'rule_name'.",&tolua_err);
2023 return 0;
2024 #endif
2025 }
2026
2027 /* function: api_methods_building_type_name_translation */
tolua_game_Building_Type_name_translation00(lua_State * tolua_S)2028 static int tolua_game_Building_Type_name_translation00(lua_State* tolua_S)
2029 {
2030 #ifndef TOLUA_RELEASE
2031 tolua_Error tolua_err;
2032 if (
2033 !tolua_isusertype(tolua_S,1,"Building_Type",0,&tolua_err) ||
2034 !tolua_isnoobj(tolua_S,2,&tolua_err)
2035 )
2036 goto tolua_lerror;
2037 else
2038 #endif
2039 {
2040 lua_State* L = tolua_S;
2041 Building_Type* self = ((Building_Type*) tolua_tousertype(tolua_S,1,0));
2042 {
2043 const char* tolua_ret = (const char*) api_methods_building_type_name_translation(L,self);
2044 tolua_pushstring(tolua_S,(const char*)tolua_ret);
2045 }
2046 }
2047 return 1;
2048 #ifndef TOLUA_RELEASE
2049 tolua_lerror:
2050 tolua_error(tolua_S,"#ferror in function 'name_translation'.",&tolua_err);
2051 return 0;
2052 #endif
2053 }
2054
2055 /* function: api_methods_unit_type_has_flag */
tolua_game_Unit_Type_has_flag00(lua_State * tolua_S)2056 static int tolua_game_Unit_Type_has_flag00(lua_State* tolua_S)
2057 {
2058 #ifndef TOLUA_RELEASE
2059 tolua_Error tolua_err;
2060 if (
2061 !tolua_isusertype(tolua_S,1,"Unit_Type",0,&tolua_err) ||
2062 !tolua_isstring(tolua_S,2,0,&tolua_err) ||
2063 !tolua_isnoobj(tolua_S,3,&tolua_err)
2064 )
2065 goto tolua_lerror;
2066 else
2067 #endif
2068 {
2069 lua_State* L = tolua_S;
2070 Unit_Type* self = ((Unit_Type*) tolua_tousertype(tolua_S,1,0));
2071 const char* flag = ((const char*) tolua_tostring(tolua_S,2,0));
2072 {
2073 bool tolua_ret = (bool) api_methods_unit_type_has_flag(L,self,flag);
2074 tolua_pushboolean(tolua_S,(bool)tolua_ret);
2075 }
2076 }
2077 return 1;
2078 #ifndef TOLUA_RELEASE
2079 tolua_lerror:
2080 tolua_error(tolua_S,"#ferror in function 'has_flag'.",&tolua_err);
2081 return 0;
2082 #endif
2083 }
2084
2085 /* function: api_methods_unit_type_has_role */
tolua_game_Unit_Type_has_role00(lua_State * tolua_S)2086 static int tolua_game_Unit_Type_has_role00(lua_State* tolua_S)
2087 {
2088 #ifndef TOLUA_RELEASE
2089 tolua_Error tolua_err;
2090 if (
2091 !tolua_isusertype(tolua_S,1,"Unit_Type",0,&tolua_err) ||
2092 !tolua_isstring(tolua_S,2,0,&tolua_err) ||
2093 !tolua_isnoobj(tolua_S,3,&tolua_err)
2094 )
2095 goto tolua_lerror;
2096 else
2097 #endif
2098 {
2099 lua_State* L = tolua_S;
2100 Unit_Type* self = ((Unit_Type*) tolua_tousertype(tolua_S,1,0));
2101 const char* role = ((const char*) tolua_tostring(tolua_S,2,0));
2102 {
2103 bool tolua_ret = (bool) api_methods_unit_type_has_role(L,self,role);
2104 tolua_pushboolean(tolua_S,(bool)tolua_ret);
2105 }
2106 }
2107 return 1;
2108 #ifndef TOLUA_RELEASE
2109 tolua_lerror:
2110 tolua_error(tolua_S,"#ferror in function 'has_role'.",&tolua_err);
2111 return 0;
2112 #endif
2113 }
2114
2115 /* function: api_methods_unit_type_rule_name */
tolua_game_Unit_Type_rule_name00(lua_State * tolua_S)2116 static int tolua_game_Unit_Type_rule_name00(lua_State* tolua_S)
2117 {
2118 #ifndef TOLUA_RELEASE
2119 tolua_Error tolua_err;
2120 if (
2121 !tolua_isusertype(tolua_S,1,"Unit_Type",0,&tolua_err) ||
2122 !tolua_isnoobj(tolua_S,2,&tolua_err)
2123 )
2124 goto tolua_lerror;
2125 else
2126 #endif
2127 {
2128 lua_State* L = tolua_S;
2129 Unit_Type* self = ((Unit_Type*) tolua_tousertype(tolua_S,1,0));
2130 {
2131 const char* tolua_ret = (const char*) api_methods_unit_type_rule_name(L,self);
2132 tolua_pushstring(tolua_S,(const char*)tolua_ret);
2133 }
2134 }
2135 return 1;
2136 #ifndef TOLUA_RELEASE
2137 tolua_lerror:
2138 tolua_error(tolua_S,"#ferror in function 'rule_name'.",&tolua_err);
2139 return 0;
2140 #endif
2141 }
2142
2143 /* function: api_methods_unit_type_name_translation */
tolua_game_Unit_Type_name_translation00(lua_State * tolua_S)2144 static int tolua_game_Unit_Type_name_translation00(lua_State* tolua_S)
2145 {
2146 #ifndef TOLUA_RELEASE
2147 tolua_Error tolua_err;
2148 if (
2149 !tolua_isusertype(tolua_S,1,"Unit_Type",0,&tolua_err) ||
2150 !tolua_isnoobj(tolua_S,2,&tolua_err)
2151 )
2152 goto tolua_lerror;
2153 else
2154 #endif
2155 {
2156 lua_State* L = tolua_S;
2157 Unit_Type* self = ((Unit_Type*) tolua_tousertype(tolua_S,1,0));
2158 {
2159 const char* tolua_ret = (const char*) api_methods_unit_type_name_translation(L,self);
2160 tolua_pushstring(tolua_S,(const char*)tolua_ret);
2161 }
2162 }
2163 return 1;
2164 #ifndef TOLUA_RELEASE
2165 tolua_lerror:
2166 tolua_error(tolua_S,"#ferror in function 'name_translation'.",&tolua_err);
2167 return 0;
2168 #endif
2169 }
2170
2171 /* function: api_methods_unit_type_can_exist_at_tile */
tolua_game_Unit_Type_can_exist_at_tile00(lua_State * tolua_S)2172 static int tolua_game_Unit_Type_can_exist_at_tile00(lua_State* tolua_S)
2173 {
2174 #ifndef TOLUA_RELEASE
2175 tolua_Error tolua_err;
2176 if (
2177 !tolua_isusertype(tolua_S,1,"Unit_Type",0,&tolua_err) ||
2178 !tolua_isusertype(tolua_S,2,"Tile",0,&tolua_err) ||
2179 !tolua_isnoobj(tolua_S,3,&tolua_err)
2180 )
2181 goto tolua_lerror;
2182 else
2183 #endif
2184 {
2185 lua_State* L = tolua_S;
2186 Unit_Type* self = ((Unit_Type*) tolua_tousertype(tolua_S,1,0));
2187 Tile* ptile = ((Tile*) tolua_tousertype(tolua_S,2,0));
2188 {
2189 bool tolua_ret = (bool) api_methods_unit_type_can_exist_at_tile(L,self,ptile);
2190 tolua_pushboolean(tolua_S,(bool)tolua_ret);
2191 }
2192 }
2193 return 1;
2194 #ifndef TOLUA_RELEASE
2195 tolua_lerror:
2196 tolua_error(tolua_S,"#ferror in function 'can_exist_at_tile'.",&tolua_err);
2197 return 0;
2198 #endif
2199 }
2200
2201 /* function: api_methods_tech_type_rule_name */
tolua_game_Tech_Type_rule_name00(lua_State * tolua_S)2202 static int tolua_game_Tech_Type_rule_name00(lua_State* tolua_S)
2203 {
2204 #ifndef TOLUA_RELEASE
2205 tolua_Error tolua_err;
2206 if (
2207 !tolua_isusertype(tolua_S,1,"Tech_Type",0,&tolua_err) ||
2208 !tolua_isnoobj(tolua_S,2,&tolua_err)
2209 )
2210 goto tolua_lerror;
2211 else
2212 #endif
2213 {
2214 lua_State* L = tolua_S;
2215 Tech_Type* self = ((Tech_Type*) tolua_tousertype(tolua_S,1,0));
2216 {
2217 const char* tolua_ret = (const char*) api_methods_tech_type_rule_name(L,self);
2218 tolua_pushstring(tolua_S,(const char*)tolua_ret);
2219 }
2220 }
2221 return 1;
2222 #ifndef TOLUA_RELEASE
2223 tolua_lerror:
2224 tolua_error(tolua_S,"#ferror in function 'rule_name'.",&tolua_err);
2225 return 0;
2226 #endif
2227 }
2228
2229 /* function: api_methods_tech_type_name_translation */
tolua_game_Tech_Type_name_translation00(lua_State * tolua_S)2230 static int tolua_game_Tech_Type_name_translation00(lua_State* tolua_S)
2231 {
2232 #ifndef TOLUA_RELEASE
2233 tolua_Error tolua_err;
2234 if (
2235 !tolua_isusertype(tolua_S,1,"Tech_Type",0,&tolua_err) ||
2236 !tolua_isnoobj(tolua_S,2,&tolua_err)
2237 )
2238 goto tolua_lerror;
2239 else
2240 #endif
2241 {
2242 lua_State* L = tolua_S;
2243 Tech_Type* self = ((Tech_Type*) tolua_tousertype(tolua_S,1,0));
2244 {
2245 const char* tolua_ret = (const char*) api_methods_tech_type_name_translation(L,self);
2246 tolua_pushstring(tolua_S,(const char*)tolua_ret);
2247 }
2248 }
2249 return 1;
2250 #ifndef TOLUA_RELEASE
2251 tolua_lerror:
2252 tolua_error(tolua_S,"#ferror in function 'name_translation'.",&tolua_err);
2253 return 0;
2254 #endif
2255 }
2256
2257 /* function: api_methods_terrain_rule_name */
tolua_game_Terrain_rule_name00(lua_State * tolua_S)2258 static int tolua_game_Terrain_rule_name00(lua_State* tolua_S)
2259 {
2260 #ifndef TOLUA_RELEASE
2261 tolua_Error tolua_err;
2262 if (
2263 !tolua_isusertype(tolua_S,1,"Terrain",0,&tolua_err) ||
2264 !tolua_isnoobj(tolua_S,2,&tolua_err)
2265 )
2266 goto tolua_lerror;
2267 else
2268 #endif
2269 {
2270 lua_State* L = tolua_S;
2271 Terrain* self = ((Terrain*) tolua_tousertype(tolua_S,1,0));
2272 {
2273 const char* tolua_ret = (const char*) api_methods_terrain_rule_name(L,self);
2274 tolua_pushstring(tolua_S,(const char*)tolua_ret);
2275 }
2276 }
2277 return 1;
2278 #ifndef TOLUA_RELEASE
2279 tolua_lerror:
2280 tolua_error(tolua_S,"#ferror in function 'rule_name'.",&tolua_err);
2281 return 0;
2282 #endif
2283 }
2284
2285 /* function: api_methods_terrain_name_translation */
tolua_game_Terrain_name_translation00(lua_State * tolua_S)2286 static int tolua_game_Terrain_name_translation00(lua_State* tolua_S)
2287 {
2288 #ifndef TOLUA_RELEASE
2289 tolua_Error tolua_err;
2290 if (
2291 !tolua_isusertype(tolua_S,1,"Terrain",0,&tolua_err) ||
2292 !tolua_isnoobj(tolua_S,2,&tolua_err)
2293 )
2294 goto tolua_lerror;
2295 else
2296 #endif
2297 {
2298 lua_State* L = tolua_S;
2299 Terrain* self = ((Terrain*) tolua_tousertype(tolua_S,1,0));
2300 {
2301 const char* tolua_ret = (const char*) api_methods_terrain_name_translation(L,self);
2302 tolua_pushstring(tolua_S,(const char*)tolua_ret);
2303 }
2304 }
2305 return 1;
2306 #ifndef TOLUA_RELEASE
2307 tolua_lerror:
2308 tolua_error(tolua_S,"#ferror in function 'name_translation'.",&tolua_err);
2309 return 0;
2310 #endif
2311 }
2312
2313 /* function: api_methods_terrain_class_name */
tolua_game_Terrain_class_name00(lua_State * tolua_S)2314 static int tolua_game_Terrain_class_name00(lua_State* tolua_S)
2315 {
2316 #ifndef TOLUA_RELEASE
2317 tolua_Error tolua_err;
2318 if (
2319 !tolua_isusertype(tolua_S,1,"Terrain",0,&tolua_err) ||
2320 !tolua_isnoobj(tolua_S,2,&tolua_err)
2321 )
2322 goto tolua_lerror;
2323 else
2324 #endif
2325 {
2326 lua_State* L = tolua_S;
2327 Terrain* self = ((Terrain*) tolua_tousertype(tolua_S,1,0));
2328 {
2329 const char* tolua_ret = (const char*) api_methods_terrain_class_name(L,self);
2330 tolua_pushstring(tolua_S,(const char*)tolua_ret);
2331 }
2332 }
2333 return 1;
2334 #ifndef TOLUA_RELEASE
2335 tolua_lerror:
2336 tolua_error(tolua_S,"#ferror in function 'class_name'.",&tolua_err);
2337 return 0;
2338 #endif
2339 }
2340
2341 /* function: api_methods_disaster_rule_name */
tolua_game_Disaster_rule_name00(lua_State * tolua_S)2342 static int tolua_game_Disaster_rule_name00(lua_State* tolua_S)
2343 {
2344 #ifndef TOLUA_RELEASE
2345 tolua_Error tolua_err;
2346 if (
2347 !tolua_isusertype(tolua_S,1,"Disaster",0,&tolua_err) ||
2348 !tolua_isnoobj(tolua_S,2,&tolua_err)
2349 )
2350 goto tolua_lerror;
2351 else
2352 #endif
2353 {
2354 lua_State* L = tolua_S;
2355 Disaster* self = ((Disaster*) tolua_tousertype(tolua_S,1,0));
2356 {
2357 const char* tolua_ret = (const char*) api_methods_disaster_rule_name(L,self);
2358 tolua_pushstring(tolua_S,(const char*)tolua_ret);
2359 }
2360 }
2361 return 1;
2362 #ifndef TOLUA_RELEASE
2363 tolua_lerror:
2364 tolua_error(tolua_S,"#ferror in function 'rule_name'.",&tolua_err);
2365 return 0;
2366 #endif
2367 }
2368
2369 /* function: api_methods_disaster_name_translation */
tolua_game_Disaster_name_translation00(lua_State * tolua_S)2370 static int tolua_game_Disaster_name_translation00(lua_State* tolua_S)
2371 {
2372 #ifndef TOLUA_RELEASE
2373 tolua_Error tolua_err;
2374 if (
2375 !tolua_isusertype(tolua_S,1,"Disaster",0,&tolua_err) ||
2376 !tolua_isnoobj(tolua_S,2,&tolua_err)
2377 )
2378 goto tolua_lerror;
2379 else
2380 #endif
2381 {
2382 lua_State* L = tolua_S;
2383 Disaster* self = ((Disaster*) tolua_tousertype(tolua_S,1,0));
2384 {
2385 const char* tolua_ret = (const char*) api_methods_disaster_name_translation(L,self);
2386 tolua_pushstring(tolua_S,(const char*)tolua_ret);
2387 }
2388 }
2389 return 1;
2390 #ifndef TOLUA_RELEASE
2391 tolua_lerror:
2392 tolua_error(tolua_S,"#ferror in function 'name_translation'.",&tolua_err);
2393 return 0;
2394 #endif
2395 }
2396
2397 /* function: api_methods_achievement_rule_name */
tolua_game_Achievement_rule_name00(lua_State * tolua_S)2398 static int tolua_game_Achievement_rule_name00(lua_State* tolua_S)
2399 {
2400 #ifndef TOLUA_RELEASE
2401 tolua_Error tolua_err;
2402 if (
2403 !tolua_isusertype(tolua_S,1,"Achievement",0,&tolua_err) ||
2404 !tolua_isnoobj(tolua_S,2,&tolua_err)
2405 )
2406 goto tolua_lerror;
2407 else
2408 #endif
2409 {
2410 lua_State* L = tolua_S;
2411 Achievement* self = ((Achievement*) tolua_tousertype(tolua_S,1,0));
2412 {
2413 const char* tolua_ret = (const char*) api_methods_achievement_rule_name(L,self);
2414 tolua_pushstring(tolua_S,(const char*)tolua_ret);
2415 }
2416 }
2417 return 1;
2418 #ifndef TOLUA_RELEASE
2419 tolua_lerror:
2420 tolua_error(tolua_S,"#ferror in function 'rule_name'.",&tolua_err);
2421 return 0;
2422 #endif
2423 }
2424
2425 /* function: api_methods_achievement_name_translation */
tolua_game_Achievement_name_translation00(lua_State * tolua_S)2426 static int tolua_game_Achievement_name_translation00(lua_State* tolua_S)
2427 {
2428 #ifndef TOLUA_RELEASE
2429 tolua_Error tolua_err;
2430 if (
2431 !tolua_isusertype(tolua_S,1,"Achievement",0,&tolua_err) ||
2432 !tolua_isnoobj(tolua_S,2,&tolua_err)
2433 )
2434 goto tolua_lerror;
2435 else
2436 #endif
2437 {
2438 lua_State* L = tolua_S;
2439 Achievement* self = ((Achievement*) tolua_tousertype(tolua_S,1,0));
2440 {
2441 const char* tolua_ret = (const char*) api_methods_achievement_name_translation(L,self);
2442 tolua_pushstring(tolua_S,(const char*)tolua_ret);
2443 }
2444 }
2445 return 1;
2446 #ifndef TOLUA_RELEASE
2447 tolua_lerror:
2448 tolua_error(tolua_S,"#ferror in function 'name_translation'.",&tolua_err);
2449 return 0;
2450 #endif
2451 }
2452
2453 /* function: api_methods_action_rule_name */
tolua_game_Action_rule_name00(lua_State * tolua_S)2454 static int tolua_game_Action_rule_name00(lua_State* tolua_S)
2455 {
2456 #ifndef TOLUA_RELEASE
2457 tolua_Error tolua_err;
2458 if (
2459 !tolua_isusertype(tolua_S,1,"Action",0,&tolua_err) ||
2460 !tolua_isnoobj(tolua_S,2,&tolua_err)
2461 )
2462 goto tolua_lerror;
2463 else
2464 #endif
2465 {
2466 lua_State* L = tolua_S;
2467 Action* self = ((Action*) tolua_tousertype(tolua_S,1,0));
2468 {
2469 const char* tolua_ret = (const char*) api_methods_action_rule_name(L,self);
2470 tolua_pushstring(tolua_S,(const char*)tolua_ret);
2471 }
2472 }
2473 return 1;
2474 #ifndef TOLUA_RELEASE
2475 tolua_lerror:
2476 tolua_error(tolua_S,"#ferror in function 'rule_name'.",&tolua_err);
2477 return 0;
2478 #endif
2479 }
2480
2481 /* function: api_methods_action_name_translation */
tolua_game_Action_name_translation00(lua_State * tolua_S)2482 static int tolua_game_Action_name_translation00(lua_State* tolua_S)
2483 {
2484 #ifndef TOLUA_RELEASE
2485 tolua_Error tolua_err;
2486 if (
2487 !tolua_isusertype(tolua_S,1,"Action",0,&tolua_err) ||
2488 !tolua_isnoobj(tolua_S,2,&tolua_err)
2489 )
2490 goto tolua_lerror;
2491 else
2492 #endif
2493 {
2494 lua_State* L = tolua_S;
2495 Action* self = ((Action*) tolua_tousertype(tolua_S,1,0));
2496 {
2497 const char* tolua_ret = (const char*) api_methods_action_name_translation(L,self);
2498 tolua_pushstring(tolua_S,(const char*)tolua_ret);
2499 }
2500 }
2501 return 1;
2502 #ifndef TOLUA_RELEASE
2503 tolua_lerror:
2504 tolua_error(tolua_S,"#ferror in function 'name_translation'.",&tolua_err);
2505 return 0;
2506 #endif
2507 }
2508
2509 /* function: api_methods_unit_list_link_data */
tolua_game_Unit_List_Link_data00(lua_State * tolua_S)2510 static int tolua_game_Unit_List_Link_data00(lua_State* tolua_S)
2511 {
2512 #ifndef TOLUA_RELEASE
2513 tolua_Error tolua_err;
2514 if (
2515 !tolua_isusertype(tolua_S,1,"Unit_List_Link",0,&tolua_err) ||
2516 !tolua_isnoobj(tolua_S,2,&tolua_err)
2517 )
2518 goto tolua_lerror;
2519 else
2520 #endif
2521 {
2522 lua_State* L = tolua_S;
2523 Unit_List_Link* self = ((Unit_List_Link*) tolua_tousertype(tolua_S,1,0));
2524 {
2525 Unit* tolua_ret = (Unit*) api_methods_unit_list_link_data(L,self);
2526 tolua_pushusertype(tolua_S,(void*)tolua_ret,"Unit");
2527 }
2528 }
2529 return 1;
2530 #ifndef TOLUA_RELEASE
2531 tolua_lerror:
2532 tolua_error(tolua_S,"#ferror in function 'data'.",&tolua_err);
2533 return 0;
2534 #endif
2535 }
2536
2537 /* function: api_methods_unit_list_next_link */
tolua_game_Unit_List_Link_next00(lua_State * tolua_S)2538 static int tolua_game_Unit_List_Link_next00(lua_State* tolua_S)
2539 {
2540 #ifndef TOLUA_RELEASE
2541 tolua_Error tolua_err;
2542 if (
2543 !tolua_isusertype(tolua_S,1,"Unit_List_Link",0,&tolua_err) ||
2544 !tolua_isnoobj(tolua_S,2,&tolua_err)
2545 )
2546 goto tolua_lerror;
2547 else
2548 #endif
2549 {
2550 lua_State* L = tolua_S;
2551 Unit_List_Link* self = ((Unit_List_Link*) tolua_tousertype(tolua_S,1,0));
2552 {
2553 Unit_List_Link* tolua_ret = (Unit_List_Link*) api_methods_unit_list_next_link(L,self);
2554 tolua_pushusertype(tolua_S,(void*)tolua_ret,"Unit_List_Link");
2555 }
2556 }
2557 return 1;
2558 #ifndef TOLUA_RELEASE
2559 tolua_lerror:
2560 tolua_error(tolua_S,"#ferror in function 'next'.",&tolua_err);
2561 return 0;
2562 #endif
2563 }
2564
2565 /* function: api_methods_city_list_link_data */
tolua_game_City_List_Link_data00(lua_State * tolua_S)2566 static int tolua_game_City_List_Link_data00(lua_State* tolua_S)
2567 {
2568 #ifndef TOLUA_RELEASE
2569 tolua_Error tolua_err;
2570 if (
2571 !tolua_isusertype(tolua_S,1,"City_List_Link",0,&tolua_err) ||
2572 !tolua_isnoobj(tolua_S,2,&tolua_err)
2573 )
2574 goto tolua_lerror;
2575 else
2576 #endif
2577 {
2578 lua_State* L = tolua_S;
2579 City_List_Link* self = ((City_List_Link*) tolua_tousertype(tolua_S,1,0));
2580 {
2581 City* tolua_ret = (City*) api_methods_city_list_link_data(L,self);
2582 tolua_pushusertype(tolua_S,(void*)tolua_ret,"City");
2583 }
2584 }
2585 return 1;
2586 #ifndef TOLUA_RELEASE
2587 tolua_lerror:
2588 tolua_error(tolua_S,"#ferror in function 'data'.",&tolua_err);
2589 return 0;
2590 #endif
2591 }
2592
2593 /* function: api_methods_city_list_next_link */
tolua_game_City_List_Link_next00(lua_State * tolua_S)2594 static int tolua_game_City_List_Link_next00(lua_State* tolua_S)
2595 {
2596 #ifndef TOLUA_RELEASE
2597 tolua_Error tolua_err;
2598 if (
2599 !tolua_isusertype(tolua_S,1,"City_List_Link",0,&tolua_err) ||
2600 !tolua_isnoobj(tolua_S,2,&tolua_err)
2601 )
2602 goto tolua_lerror;
2603 else
2604 #endif
2605 {
2606 lua_State* L = tolua_S;
2607 City_List_Link* self = ((City_List_Link*) tolua_tousertype(tolua_S,1,0));
2608 {
2609 City_List_Link* tolua_ret = (City_List_Link*) api_methods_city_list_next_link(L,self);
2610 tolua_pushusertype(tolua_S,(void*)tolua_ret,"City_List_Link");
2611 }
2612 }
2613 return 1;
2614 #ifndef TOLUA_RELEASE
2615 tolua_lerror:
2616 tolua_error(tolua_S,"#ferror in function 'next'.",&tolua_err);
2617 return 0;
2618 #endif
2619 }
2620
2621 /* function: api_find_player */
tolua_game_find_player00(lua_State * tolua_S)2622 static int tolua_game_find_player00(lua_State* tolua_S)
2623 {
2624 #ifndef TOLUA_RELEASE
2625 tolua_Error tolua_err;
2626 if (
2627 !tolua_isnumber(tolua_S,1,0,&tolua_err) ||
2628 !tolua_isnoobj(tolua_S,2,&tolua_err)
2629 )
2630 goto tolua_lerror;
2631 else
2632 #endif
2633 {
2634 lua_State* L = tolua_S;
2635 int player_id = ((int) tolua_tonumber(tolua_S,1,0));
2636 {
2637 Player* tolua_ret = (Player*) api_find_player(L,player_id);
2638 tolua_pushusertype(tolua_S,(void*)tolua_ret,"Player");
2639 }
2640 }
2641 return 1;
2642 #ifndef TOLUA_RELEASE
2643 tolua_lerror:
2644 tolua_error(tolua_S,"#ferror in function 'player'.",&tolua_err);
2645 return 0;
2646 #endif
2647 }
2648
2649 /* function: api_find_city */
tolua_game_find_city00(lua_State * tolua_S)2650 static int tolua_game_find_city00(lua_State* tolua_S)
2651 {
2652 #ifndef TOLUA_RELEASE
2653 tolua_Error tolua_err;
2654 if (
2655 !tolua_isusertype(tolua_S,1,"Player",0,&tolua_err) ||
2656 !tolua_isnumber(tolua_S,2,0,&tolua_err) ||
2657 !tolua_isnoobj(tolua_S,3,&tolua_err)
2658 )
2659 goto tolua_lerror;
2660 else
2661 #endif
2662 {
2663 lua_State* L = tolua_S;
2664 Player* pplayer = ((Player*) tolua_tousertype(tolua_S,1,0));
2665 int city_id = ((int) tolua_tonumber(tolua_S,2,0));
2666 {
2667 City* tolua_ret = (City*) api_find_city(L,pplayer,city_id);
2668 tolua_pushusertype(tolua_S,(void*)tolua_ret,"City");
2669 }
2670 }
2671 return 1;
2672 #ifndef TOLUA_RELEASE
2673 tolua_lerror:
2674 tolua_error(tolua_S,"#ferror in function 'city'.",&tolua_err);
2675 return 0;
2676 #endif
2677 }
2678
2679 /* function: api_find_unit */
tolua_game_find_unit00(lua_State * tolua_S)2680 static int tolua_game_find_unit00(lua_State* tolua_S)
2681 {
2682 #ifndef TOLUA_RELEASE
2683 tolua_Error tolua_err;
2684 if (
2685 !tolua_isusertype(tolua_S,1,"Player",0,&tolua_err) ||
2686 !tolua_isnumber(tolua_S,2,0,&tolua_err) ||
2687 !tolua_isnoobj(tolua_S,3,&tolua_err)
2688 )
2689 goto tolua_lerror;
2690 else
2691 #endif
2692 {
2693 lua_State* L = tolua_S;
2694 Player* pplayer = ((Player*) tolua_tousertype(tolua_S,1,0));
2695 int unit_id = ((int) tolua_tonumber(tolua_S,2,0));
2696 {
2697 Unit* tolua_ret = (Unit*) api_find_unit(L,pplayer,unit_id);
2698 tolua_pushusertype(tolua_S,(void*)tolua_ret,"Unit");
2699 }
2700 }
2701 return 1;
2702 #ifndef TOLUA_RELEASE
2703 tolua_lerror:
2704 tolua_error(tolua_S,"#ferror in function 'unit'.",&tolua_err);
2705 return 0;
2706 #endif
2707 }
2708
2709 /* function: api_find_transport_unit */
tolua_game_find_transport_unit00(lua_State * tolua_S)2710 static int tolua_game_find_transport_unit00(lua_State* tolua_S)
2711 {
2712 #ifndef TOLUA_RELEASE
2713 tolua_Error tolua_err;
2714 if (
2715 !tolua_isusertype(tolua_S,1,"Player",0,&tolua_err) ||
2716 !tolua_isusertype(tolua_S,2,"Unit_Type",0,&tolua_err) ||
2717 !tolua_isusertype(tolua_S,3,"Tile",0,&tolua_err) ||
2718 !tolua_isnoobj(tolua_S,4,&tolua_err)
2719 )
2720 goto tolua_lerror;
2721 else
2722 #endif
2723 {
2724 lua_State* L = tolua_S;
2725 Player* pplayer = ((Player*) tolua_tousertype(tolua_S,1,0));
2726 Unit_Type* ptype = ((Unit_Type*) tolua_tousertype(tolua_S,2,0));
2727 Tile* ptile = ((Tile*) tolua_tousertype(tolua_S,3,0));
2728 {
2729 Unit* tolua_ret = (Unit*) api_find_transport_unit(L,pplayer,ptype,ptile);
2730 tolua_pushusertype(tolua_S,(void*)tolua_ret,"Unit");
2731 }
2732 }
2733 return 1;
2734 #ifndef TOLUA_RELEASE
2735 tolua_lerror:
2736 tolua_error(tolua_S,"#ferror in function 'transport_unit'.",&tolua_err);
2737 return 0;
2738 #endif
2739 }
2740
2741 /* function: api_find_tile */
tolua_game_find_tile00(lua_State * tolua_S)2742 static int tolua_game_find_tile00(lua_State* tolua_S)
2743 {
2744 #ifndef TOLUA_RELEASE
2745 tolua_Error tolua_err;
2746 if (
2747 !tolua_isnumber(tolua_S,1,0,&tolua_err) ||
2748 !tolua_isnumber(tolua_S,2,0,&tolua_err) ||
2749 !tolua_isnoobj(tolua_S,3,&tolua_err)
2750 )
2751 goto tolua_lerror;
2752 else
2753 #endif
2754 {
2755 lua_State* L = tolua_S;
2756 int nat_x = ((int) tolua_tonumber(tolua_S,1,0));
2757 int nat_y = ((int) tolua_tonumber(tolua_S,2,0));
2758 {
2759 Tile* tolua_ret = (Tile*) api_find_tile(L,nat_x,nat_y);
2760 tolua_pushusertype(tolua_S,(void*)tolua_ret,"Tile");
2761 }
2762 }
2763 return 1;
2764 #ifndef TOLUA_RELEASE
2765 tolua_lerror:
2766 tolua_error(tolua_S,"#ferror in function 'tile'.",&tolua_err);
2767 return 0;
2768 #endif
2769 }
2770
2771 /* function: api_find_tile_by_index */
tolua_game_find_tile01(lua_State * tolua_S)2772 static int tolua_game_find_tile01(lua_State* tolua_S)
2773 {
2774 tolua_Error tolua_err;
2775 if (
2776 !tolua_isnumber(tolua_S,1,0,&tolua_err) ||
2777 !tolua_isnoobj(tolua_S,2,&tolua_err)
2778 )
2779 goto tolua_lerror;
2780 else
2781 {
2782 lua_State* L = tolua_S;
2783 int tindex = ((int) tolua_tonumber(tolua_S,1,0));
2784 {
2785 Tile* tolua_ret = (Tile*) api_find_tile_by_index(L,tindex);
2786 tolua_pushusertype(tolua_S,(void*)tolua_ret,"Tile");
2787 }
2788 }
2789 return 1;
2790 tolua_lerror:
2791 return tolua_game_find_tile00(tolua_S);
2792 }
2793
2794 /* function: api_find_government_by_name */
tolua_game_find_government00(lua_State * tolua_S)2795 static int tolua_game_find_government00(lua_State* tolua_S)
2796 {
2797 #ifndef TOLUA_RELEASE
2798 tolua_Error tolua_err;
2799 if (
2800 !tolua_isstring(tolua_S,1,0,&tolua_err) ||
2801 !tolua_isnoobj(tolua_S,2,&tolua_err)
2802 )
2803 goto tolua_lerror;
2804 else
2805 #endif
2806 {
2807 lua_State* L = tolua_S;
2808 const char* name_orig = ((const char*) tolua_tostring(tolua_S,1,0));
2809 {
2810 Government* tolua_ret = (Government*) api_find_government_by_name(L,name_orig);
2811 tolua_pushusertype(tolua_S,(void*)tolua_ret,"Government");
2812 }
2813 }
2814 return 1;
2815 #ifndef TOLUA_RELEASE
2816 tolua_lerror:
2817 tolua_error(tolua_S,"#ferror in function 'government'.",&tolua_err);
2818 return 0;
2819 #endif
2820 }
2821
2822 /* function: api_find_government */
tolua_game_find_government01(lua_State * tolua_S)2823 static int tolua_game_find_government01(lua_State* tolua_S)
2824 {
2825 tolua_Error tolua_err;
2826 if (
2827 !tolua_isnumber(tolua_S,1,0,&tolua_err) ||
2828 !tolua_isnoobj(tolua_S,2,&tolua_err)
2829 )
2830 goto tolua_lerror;
2831 else
2832 {
2833 lua_State* L = tolua_S;
2834 int government_id = ((int) tolua_tonumber(tolua_S,1,0));
2835 {
2836 Government* tolua_ret = (Government*) api_find_government(L,government_id);
2837 tolua_pushusertype(tolua_S,(void*)tolua_ret,"Government");
2838 }
2839 }
2840 return 1;
2841 tolua_lerror:
2842 return tolua_game_find_government00(tolua_S);
2843 }
2844
2845 /* function: api_find_nation_type_by_name */
tolua_game_find_nation_type00(lua_State * tolua_S)2846 static int tolua_game_find_nation_type00(lua_State* tolua_S)
2847 {
2848 #ifndef TOLUA_RELEASE
2849 tolua_Error tolua_err;
2850 if (
2851 !tolua_isstring(tolua_S,1,0,&tolua_err) ||
2852 !tolua_isnoobj(tolua_S,2,&tolua_err)
2853 )
2854 goto tolua_lerror;
2855 else
2856 #endif
2857 {
2858 lua_State* L = tolua_S;
2859 const char* name_orig = ((const char*) tolua_tostring(tolua_S,1,0));
2860 {
2861 Nation_Type* tolua_ret = (Nation_Type*) api_find_nation_type_by_name(L,name_orig);
2862 tolua_pushusertype(tolua_S,(void*)tolua_ret,"Nation_Type");
2863 }
2864 }
2865 return 1;
2866 #ifndef TOLUA_RELEASE
2867 tolua_lerror:
2868 tolua_error(tolua_S,"#ferror in function 'nation_type'.",&tolua_err);
2869 return 0;
2870 #endif
2871 }
2872
2873 /* function: api_find_nation_type */
tolua_game_find_nation_type01(lua_State * tolua_S)2874 static int tolua_game_find_nation_type01(lua_State* tolua_S)
2875 {
2876 tolua_Error tolua_err;
2877 if (
2878 !tolua_isnumber(tolua_S,1,0,&tolua_err) ||
2879 !tolua_isnoobj(tolua_S,2,&tolua_err)
2880 )
2881 goto tolua_lerror;
2882 else
2883 {
2884 lua_State* L = tolua_S;
2885 int nation_type_id = ((int) tolua_tonumber(tolua_S,1,0));
2886 {
2887 Nation_Type* tolua_ret = (Nation_Type*) api_find_nation_type(L,nation_type_id);
2888 tolua_pushusertype(tolua_S,(void*)tolua_ret,"Nation_Type");
2889 }
2890 }
2891 return 1;
2892 tolua_lerror:
2893 return tolua_game_find_nation_type00(tolua_S);
2894 }
2895
2896 /* function: api_find_building_type_by_name */
tolua_game_find_building_type00(lua_State * tolua_S)2897 static int tolua_game_find_building_type00(lua_State* tolua_S)
2898 {
2899 #ifndef TOLUA_RELEASE
2900 tolua_Error tolua_err;
2901 if (
2902 !tolua_isstring(tolua_S,1,0,&tolua_err) ||
2903 !tolua_isnoobj(tolua_S,2,&tolua_err)
2904 )
2905 goto tolua_lerror;
2906 else
2907 #endif
2908 {
2909 lua_State* L = tolua_S;
2910 const char* name_orig = ((const char*) tolua_tostring(tolua_S,1,0));
2911 {
2912 Building_Type* tolua_ret = (Building_Type*) api_find_building_type_by_name(L,name_orig);
2913 tolua_pushusertype(tolua_S,(void*)tolua_ret,"Building_Type");
2914 }
2915 }
2916 return 1;
2917 #ifndef TOLUA_RELEASE
2918 tolua_lerror:
2919 tolua_error(tolua_S,"#ferror in function 'building_type'.",&tolua_err);
2920 return 0;
2921 #endif
2922 }
2923
2924 /* function: api_find_building_type */
tolua_game_find_building_type01(lua_State * tolua_S)2925 static int tolua_game_find_building_type01(lua_State* tolua_S)
2926 {
2927 tolua_Error tolua_err;
2928 if (
2929 !tolua_isnumber(tolua_S,1,0,&tolua_err) ||
2930 !tolua_isnoobj(tolua_S,2,&tolua_err)
2931 )
2932 goto tolua_lerror;
2933 else
2934 {
2935 lua_State* L = tolua_S;
2936 int building_type_id = ((int) tolua_tonumber(tolua_S,1,0));
2937 {
2938 Building_Type* tolua_ret = (Building_Type*) api_find_building_type(L,building_type_id);
2939 tolua_pushusertype(tolua_S,(void*)tolua_ret,"Building_Type");
2940 }
2941 }
2942 return 1;
2943 tolua_lerror:
2944 return tolua_game_find_building_type00(tolua_S);
2945 }
2946
2947 /* function: api_find_unit_type_by_name */
tolua_game_find_unit_type00(lua_State * tolua_S)2948 static int tolua_game_find_unit_type00(lua_State* tolua_S)
2949 {
2950 #ifndef TOLUA_RELEASE
2951 tolua_Error tolua_err;
2952 if (
2953 !tolua_isstring(tolua_S,1,0,&tolua_err) ||
2954 !tolua_isnoobj(tolua_S,2,&tolua_err)
2955 )
2956 goto tolua_lerror;
2957 else
2958 #endif
2959 {
2960 lua_State* L = tolua_S;
2961 const char* name_orig = ((const char*) tolua_tostring(tolua_S,1,0));
2962 {
2963 Unit_Type* tolua_ret = (Unit_Type*) api_find_unit_type_by_name(L,name_orig);
2964 tolua_pushusertype(tolua_S,(void*)tolua_ret,"Unit_Type");
2965 }
2966 }
2967 return 1;
2968 #ifndef TOLUA_RELEASE
2969 tolua_lerror:
2970 tolua_error(tolua_S,"#ferror in function 'unit_type'.",&tolua_err);
2971 return 0;
2972 #endif
2973 }
2974
2975 /* function: api_find_unit_type */
tolua_game_find_unit_type01(lua_State * tolua_S)2976 static int tolua_game_find_unit_type01(lua_State* tolua_S)
2977 {
2978 tolua_Error tolua_err;
2979 if (
2980 !tolua_isnumber(tolua_S,1,0,&tolua_err) ||
2981 !tolua_isnoobj(tolua_S,2,&tolua_err)
2982 )
2983 goto tolua_lerror;
2984 else
2985 {
2986 lua_State* L = tolua_S;
2987 int unit_type_id = ((int) tolua_tonumber(tolua_S,1,0));
2988 {
2989 Unit_Type* tolua_ret = (Unit_Type*) api_find_unit_type(L,unit_type_id);
2990 tolua_pushusertype(tolua_S,(void*)tolua_ret,"Unit_Type");
2991 }
2992 }
2993 return 1;
2994 tolua_lerror:
2995 return tolua_game_find_unit_type00(tolua_S);
2996 }
2997
2998 /* function: api_find_role_unit_type */
tolua_game_find_role_unit_type00(lua_State * tolua_S)2999 static int tolua_game_find_role_unit_type00(lua_State* tolua_S)
3000 {
3001 #ifndef TOLUA_RELEASE
3002 tolua_Error tolua_err;
3003 if (
3004 !tolua_isstring(tolua_S,1,0,&tolua_err) ||
3005 !tolua_isusertype(tolua_S,2,"Player",0,&tolua_err) ||
3006 !tolua_isnoobj(tolua_S,3,&tolua_err)
3007 )
3008 goto tolua_lerror;
3009 else
3010 #endif
3011 {
3012 lua_State* L = tolua_S;
3013 const char* role_name = ((const char*) tolua_tostring(tolua_S,1,0));
3014 Player* pplayer = ((Player*) tolua_tousertype(tolua_S,2,0));
3015 {
3016 Unit_Type* tolua_ret = (Unit_Type*) api_find_role_unit_type(L,role_name,pplayer);
3017 tolua_pushusertype(tolua_S,(void*)tolua_ret,"Unit_Type");
3018 }
3019 }
3020 return 1;
3021 #ifndef TOLUA_RELEASE
3022 tolua_lerror:
3023 tolua_error(tolua_S,"#ferror in function 'role_unit_type'.",&tolua_err);
3024 return 0;
3025 #endif
3026 }
3027
3028 /* function: api_find_tech_type_by_name */
tolua_game_find_tech_type00(lua_State * tolua_S)3029 static int tolua_game_find_tech_type00(lua_State* tolua_S)
3030 {
3031 #ifndef TOLUA_RELEASE
3032 tolua_Error tolua_err;
3033 if (
3034 !tolua_isstring(tolua_S,1,0,&tolua_err) ||
3035 !tolua_isnoobj(tolua_S,2,&tolua_err)
3036 )
3037 goto tolua_lerror;
3038 else
3039 #endif
3040 {
3041 lua_State* L = tolua_S;
3042 const char* name_orig = ((const char*) tolua_tostring(tolua_S,1,0));
3043 {
3044 Tech_Type* tolua_ret = (Tech_Type*) api_find_tech_type_by_name(L,name_orig);
3045 tolua_pushusertype(tolua_S,(void*)tolua_ret,"Tech_Type");
3046 }
3047 }
3048 return 1;
3049 #ifndef TOLUA_RELEASE
3050 tolua_lerror:
3051 tolua_error(tolua_S,"#ferror in function 'tech_type'.",&tolua_err);
3052 return 0;
3053 #endif
3054 }
3055
3056 /* function: api_find_tech_type */
tolua_game_find_tech_type01(lua_State * tolua_S)3057 static int tolua_game_find_tech_type01(lua_State* tolua_S)
3058 {
3059 tolua_Error tolua_err;
3060 if (
3061 !tolua_isnumber(tolua_S,1,0,&tolua_err) ||
3062 !tolua_isnoobj(tolua_S,2,&tolua_err)
3063 )
3064 goto tolua_lerror;
3065 else
3066 {
3067 lua_State* L = tolua_S;
3068 int tech_type_id = ((int) tolua_tonumber(tolua_S,1,0));
3069 {
3070 Tech_Type* tolua_ret = (Tech_Type*) api_find_tech_type(L,tech_type_id);
3071 tolua_pushusertype(tolua_S,(void*)tolua_ret,"Tech_Type");
3072 }
3073 }
3074 return 1;
3075 tolua_lerror:
3076 return tolua_game_find_tech_type00(tolua_S);
3077 }
3078
3079 /* function: api_find_terrain_by_name */
tolua_game_find_terrain00(lua_State * tolua_S)3080 static int tolua_game_find_terrain00(lua_State* tolua_S)
3081 {
3082 #ifndef TOLUA_RELEASE
3083 tolua_Error tolua_err;
3084 if (
3085 !tolua_isstring(tolua_S,1,0,&tolua_err) ||
3086 !tolua_isnoobj(tolua_S,2,&tolua_err)
3087 )
3088 goto tolua_lerror;
3089 else
3090 #endif
3091 {
3092 lua_State* L = tolua_S;
3093 const char* name_orig = ((const char*) tolua_tostring(tolua_S,1,0));
3094 {
3095 Terrain* tolua_ret = (Terrain*) api_find_terrain_by_name(L,name_orig);
3096 tolua_pushusertype(tolua_S,(void*)tolua_ret,"Terrain");
3097 }
3098 }
3099 return 1;
3100 #ifndef TOLUA_RELEASE
3101 tolua_lerror:
3102 tolua_error(tolua_S,"#ferror in function 'terrain'.",&tolua_err);
3103 return 0;
3104 #endif
3105 }
3106
3107 /* function: api_find_terrain */
tolua_game_find_terrain01(lua_State * tolua_S)3108 static int tolua_game_find_terrain01(lua_State* tolua_S)
3109 {
3110 tolua_Error tolua_err;
3111 if (
3112 !tolua_isnumber(tolua_S,1,0,&tolua_err) ||
3113 !tolua_isnoobj(tolua_S,2,&tolua_err)
3114 )
3115 goto tolua_lerror;
3116 else
3117 {
3118 lua_State* L = tolua_S;
3119 int terrain_id = ((int) tolua_tonumber(tolua_S,1,0));
3120 {
3121 Terrain* tolua_ret = (Terrain*) api_find_terrain(L,terrain_id);
3122 tolua_pushusertype(tolua_S,(void*)tolua_ret,"Terrain");
3123 }
3124 }
3125 return 1;
3126 tolua_lerror:
3127 return tolua_game_find_terrain00(tolua_S);
3128 }
3129
3130 /* function: api_find_nonexistent */
tolua_game_find_nonexistent00(lua_State * tolua_S)3131 static int tolua_game_find_nonexistent00(lua_State* tolua_S)
3132 {
3133 #ifndef TOLUA_RELEASE
3134 tolua_Error tolua_err;
3135 if (
3136 !tolua_isnoobj(tolua_S,1,&tolua_err)
3137 )
3138 goto tolua_lerror;
3139 else
3140 #endif
3141 {
3142 lua_State* L = tolua_S;
3143 {
3144 Nonexistent* tolua_ret = (Nonexistent*) api_find_nonexistent(L);
3145 tolua_pushusertype(tolua_S,(void*)tolua_ret,"Nonexistent");
3146 }
3147 }
3148 return 1;
3149 #ifndef TOLUA_RELEASE
3150 tolua_lerror:
3151 tolua_error(tolua_S,"#ferror in function 'nonexistent'.",&tolua_err);
3152 return 0;
3153 #endif
3154 }
3155
3156 /* function: api_effects_world_bonus */
tolua_game_effects_world_bonus00(lua_State * tolua_S)3157 static int tolua_game_effects_world_bonus00(lua_State* tolua_S)
3158 {
3159 #ifndef TOLUA_RELEASE
3160 tolua_Error tolua_err;
3161 if (
3162 !tolua_isstring(tolua_S,1,0,&tolua_err) ||
3163 !tolua_isnoobj(tolua_S,2,&tolua_err)
3164 )
3165 goto tolua_lerror;
3166 else
3167 #endif
3168 {
3169 lua_State* L = tolua_S;
3170 const char* effect_type = ((const char*) tolua_tostring(tolua_S,1,0));
3171 {
3172 int tolua_ret = (int) api_effects_world_bonus(L,effect_type);
3173 tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
3174 }
3175 }
3176 return 1;
3177 #ifndef TOLUA_RELEASE
3178 tolua_lerror:
3179 tolua_error(tolua_S,"#ferror in function 'world_bonus'.",&tolua_err);
3180 return 0;
3181 #endif
3182 }
3183
3184 /* function: api_effects_player_bonus */
tolua_game_effects_player_bonus00(lua_State * tolua_S)3185 static int tolua_game_effects_player_bonus00(lua_State* tolua_S)
3186 {
3187 #ifndef TOLUA_RELEASE
3188 tolua_Error tolua_err;
3189 if (
3190 !tolua_isusertype(tolua_S,1,"Player",0,&tolua_err) ||
3191 !tolua_isstring(tolua_S,2,0,&tolua_err) ||
3192 !tolua_isnoobj(tolua_S,3,&tolua_err)
3193 )
3194 goto tolua_lerror;
3195 else
3196 #endif
3197 {
3198 lua_State* L = tolua_S;
3199 Player* pplayer = ((Player*) tolua_tousertype(tolua_S,1,0));
3200 const char* effect_type = ((const char*) tolua_tostring(tolua_S,2,0));
3201 {
3202 int tolua_ret = (int) api_effects_player_bonus(L,pplayer,effect_type);
3203 tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
3204 }
3205 }
3206 return 1;
3207 #ifndef TOLUA_RELEASE
3208 tolua_lerror:
3209 tolua_error(tolua_S,"#ferror in function 'player_bonus'.",&tolua_err);
3210 return 0;
3211 #endif
3212 }
3213
3214 /* function: api_effects_city_bonus */
tolua_game_effects_city_bonus00(lua_State * tolua_S)3215 static int tolua_game_effects_city_bonus00(lua_State* tolua_S)
3216 {
3217 #ifndef TOLUA_RELEASE
3218 tolua_Error tolua_err;
3219 if (
3220 !tolua_isusertype(tolua_S,1,"City",0,&tolua_err) ||
3221 !tolua_isstring(tolua_S,2,0,&tolua_err) ||
3222 !tolua_isnoobj(tolua_S,3,&tolua_err)
3223 )
3224 goto tolua_lerror;
3225 else
3226 #endif
3227 {
3228 lua_State* L = tolua_S;
3229 City* pcity = ((City*) tolua_tousertype(tolua_S,1,0));
3230 const char* effect_type = ((const char*) tolua_tostring(tolua_S,2,0));
3231 {
3232 int tolua_ret = (int) api_effects_city_bonus(L,pcity,effect_type);
3233 tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
3234 }
3235 }
3236 return 1;
3237 #ifndef TOLUA_RELEASE
3238 tolua_lerror:
3239 tolua_error(tolua_S,"#ferror in function 'city_bonus'.",&tolua_err);
3240 return 0;
3241 #endif
3242 }
3243
3244 /* function: api_utilities_str2dir */
tolua_game_direction_str2dir00(lua_State * tolua_S)3245 static int tolua_game_direction_str2dir00(lua_State* tolua_S)
3246 {
3247 #ifndef TOLUA_RELEASE
3248 tolua_Error tolua_err;
3249 if (
3250 !tolua_isstring(tolua_S,1,0,&tolua_err) ||
3251 !tolua_isnoobj(tolua_S,2,&tolua_err)
3252 )
3253 goto tolua_lerror;
3254 else
3255 #endif
3256 {
3257 lua_State* L = tolua_S;
3258 const char* str = ((const char*) tolua_tostring(tolua_S,1,0));
3259 {
3260 Direction* tolua_ret = (Direction*) api_utilities_str2dir(L,str);
3261 tolua_pushusertype(tolua_S,(void*)tolua_ret,"Direction");
3262 }
3263 }
3264 return 1;
3265 #ifndef TOLUA_RELEASE
3266 tolua_lerror:
3267 tolua_error(tolua_S,"#ferror in function 'str2dir'.",&tolua_err);
3268 return 0;
3269 #endif
3270 }
3271
3272 /* function: api_utilities_dir_ccw */
tolua_game_direction_next_ccw00(lua_State * tolua_S)3273 static int tolua_game_direction_next_ccw00(lua_State* tolua_S)
3274 {
3275 #ifndef TOLUA_RELEASE
3276 tolua_Error tolua_err;
3277 if (
3278 !tolua_isusertype(tolua_S,1,"Direction",0,&tolua_err) ||
3279 !tolua_isnoobj(tolua_S,2,&tolua_err)
3280 )
3281 goto tolua_lerror;
3282 else
3283 #endif
3284 {
3285 lua_State* L = tolua_S;
3286 Direction self = *((Direction*) tolua_tousertype(tolua_S,1,0));
3287 {
3288 Direction* tolua_ret = (Direction*) api_utilities_dir_ccw(L,self);
3289 tolua_pushusertype(tolua_S,(void*)tolua_ret,"Direction");
3290 }
3291 }
3292 return 1;
3293 #ifndef TOLUA_RELEASE
3294 tolua_lerror:
3295 tolua_error(tolua_S,"#ferror in function 'next_ccw'.",&tolua_err);
3296 return 0;
3297 #endif
3298 }
3299
3300 /* function: api_utilities_dir_cw */
tolua_game_direction_next_cw00(lua_State * tolua_S)3301 static int tolua_game_direction_next_cw00(lua_State* tolua_S)
3302 {
3303 #ifndef TOLUA_RELEASE
3304 tolua_Error tolua_err;
3305 if (
3306 !tolua_isusertype(tolua_S,1,"Direction",0,&tolua_err) ||
3307 !tolua_isnoobj(tolua_S,2,&tolua_err)
3308 )
3309 goto tolua_lerror;
3310 else
3311 #endif
3312 {
3313 lua_State* L = tolua_S;
3314 Direction self = *((Direction*) tolua_tousertype(tolua_S,1,0));
3315 {
3316 Direction* tolua_ret = (Direction*) api_utilities_dir_cw(L,self);
3317 tolua_pushusertype(tolua_S,(void*)tolua_ret,"Direction");
3318 }
3319 }
3320 return 1;
3321 #ifndef TOLUA_RELEASE
3322 tolua_lerror:
3323 tolua_error(tolua_S,"#ferror in function 'next_cw'.",&tolua_err);
3324 return 0;
3325 #endif
3326 }
3327
3328 /* function: api_utilities_opposite_dir */
tolua_game_direction_opposite00(lua_State * tolua_S)3329 static int tolua_game_direction_opposite00(lua_State* tolua_S)
3330 {
3331 #ifndef TOLUA_RELEASE
3332 tolua_Error tolua_err;
3333 if (
3334 !tolua_isusertype(tolua_S,1,"Direction",0,&tolua_err) ||
3335 !tolua_isnoobj(tolua_S,2,&tolua_err)
3336 )
3337 goto tolua_lerror;
3338 else
3339 #endif
3340 {
3341 lua_State* L = tolua_S;
3342 Direction self = *((Direction*) tolua_tousertype(tolua_S,1,0));
3343 {
3344 Direction* tolua_ret = (Direction*) api_utilities_opposite_dir(L,self);
3345 tolua_pushusertype(tolua_S,(void*)tolua_ret,"Direction");
3346 }
3347 }
3348 return 1;
3349 #ifndef TOLUA_RELEASE
3350 tolua_lerror:
3351 tolua_error(tolua_S,"#ferror in function 'opposite'.",&tolua_err);
3352 return 0;
3353 #endif
3354 }
3355
3356 /* Open lib function */
luaopen_game(lua_State * tolua_S)3357 LUALIB_API int luaopen_game (lua_State* tolua_S)
3358 {
3359 tolua_open(tolua_S);
3360 tolua_reg_types(tolua_S);
3361 tolua_module(tolua_S,NULL,0);
3362 tolua_beginmodule(tolua_S,NULL);
3363 tolua_cclass(tolua_S,"Player","Player","",NULL);
3364 tolua_beginmodule(tolua_S,"Player");
3365 tolua_variable(tolua_S,"name",tolua_get_Player_Player_name,NULL);
3366 tolua_variable(tolua_S,"nation",tolua_get_Player_Player_nation_ptr,tolua_set_Player_Player_nation_ptr);
3367 tolua_variable(tolua_S,"ai_controlled",tolua_get_Player_Player_ai_controlled,tolua_set_Player_Player_ai_controlled);
3368 tolua_variable(tolua_S,"is_alive",tolua_get_Player_Player_is_alive,tolua_set_Player_Player_is_alive);
3369 tolua_endmodule(tolua_S);
3370 tolua_cclass(tolua_S,"City","City","",NULL);
3371 tolua_beginmodule(tolua_S,"City");
3372 tolua_variable(tolua_S,"name",tolua_get_City_City_name,NULL);
3373 tolua_variable(tolua_S,"owner",tolua_get_City_City_owner_ptr,tolua_set_City_City_owner_ptr);
3374 tolua_variable(tolua_S,"original",tolua_get_City_City_original_ptr,tolua_set_City_City_original_ptr);
3375 tolua_variable(tolua_S,"id",tolua_get_City_City_id,NULL);
3376 tolua_endmodule(tolua_S);
3377 tolua_cclass(tolua_S,"Connection","Connection","",NULL);
3378 tolua_beginmodule(tolua_S,"Connection");
3379 tolua_variable(tolua_S,"id",tolua_get_Connection_Connection_id,NULL);
3380 tolua_endmodule(tolua_S);
3381 tolua_cclass(tolua_S,"Unit","Unit","",NULL);
3382 tolua_beginmodule(tolua_S,"Unit");
3383 tolua_variable(tolua_S,"utype",tolua_get_Unit_Unit_utype_ptr,tolua_set_Unit_Unit_utype_ptr);
3384 tolua_variable(tolua_S,"owner",tolua_get_Unit_Unit_owner_ptr,tolua_set_Unit_Unit_owner_ptr);
3385 tolua_variable(tolua_S,"homecity",tolua_get_Unit_Unit_homecity,tolua_set_Unit_Unit_homecity);
3386 tolua_variable(tolua_S,"id",tolua_get_Unit_Unit_id,NULL);
3387 tolua_endmodule(tolua_S);
3388 tolua_cclass(tolua_S,"Tile","Tile","",NULL);
3389 tolua_beginmodule(tolua_S,"Tile");
3390 tolua_variable(tolua_S,"terrain",tolua_get_Tile_Tile_terrain_ptr,tolua_set_Tile_Tile_terrain_ptr);
3391 tolua_variable(tolua_S,"id",tolua_get_Tile_Tile_index,NULL);
3392 tolua_endmodule(tolua_S);
3393 tolua_cclass(tolua_S,"Government","Government","",NULL);
3394 tolua_beginmodule(tolua_S,"Government");
3395 tolua_variable(tolua_S,"id",tolua_get_Government_Government_item_number,NULL);
3396 tolua_endmodule(tolua_S);
3397 tolua_cclass(tolua_S,"Nation_Type","Nation_Type","",NULL);
3398 tolua_beginmodule(tolua_S,"Nation_Type");
3399 tolua_variable(tolua_S,"id",tolua_get_Nation_Type_Nation_Type_item_number,NULL);
3400 tolua_endmodule(tolua_S);
3401 tolua_cclass(tolua_S,"Building_Type","Building_Type","",NULL);
3402 tolua_beginmodule(tolua_S,"Building_Type");
3403 tolua_variable(tolua_S,"build_cost",tolua_get_Building_Type_Building_Type_build_cost,tolua_set_Building_Type_Building_Type_build_cost);
3404 tolua_variable(tolua_S,"id",tolua_get_Building_Type_Building_Type_item_number,NULL);
3405 tolua_endmodule(tolua_S);
3406 tolua_cclass(tolua_S,"Unit_Type","Unit_Type","",NULL);
3407 tolua_beginmodule(tolua_S,"Unit_Type");
3408 tolua_variable(tolua_S,"build_cost",tolua_get_Unit_Type_Unit_Type_build_cost,tolua_set_Unit_Type_Unit_Type_build_cost);
3409 tolua_variable(tolua_S,"id",tolua_get_Unit_Type_Unit_Type_item_number,NULL);
3410 tolua_endmodule(tolua_S);
3411 tolua_cclass(tolua_S,"Tech_Type","Tech_Type","",NULL);
3412 tolua_beginmodule(tolua_S,"Tech_Type");
3413 tolua_variable(tolua_S,"id",tolua_get_Tech_Type_Tech_Type_item_number,NULL);
3414 tolua_endmodule(tolua_S);
3415 tolua_cclass(tolua_S,"Terrain","Terrain","",NULL);
3416 tolua_beginmodule(tolua_S,"Terrain");
3417 tolua_variable(tolua_S,"id",tolua_get_Terrain_Terrain_item_number,NULL);
3418 tolua_endmodule(tolua_S);
3419 tolua_cclass(tolua_S,"Disaster","Disaster","",NULL);
3420 tolua_beginmodule(tolua_S,"Disaster");
3421 tolua_variable(tolua_S,"id",tolua_get_Disaster_Disaster_id,NULL);
3422 tolua_endmodule(tolua_S);
3423 tolua_cclass(tolua_S,"Achievement","Achievement","",NULL);
3424 tolua_beginmodule(tolua_S,"Achievement");
3425 tolua_variable(tolua_S,"id",tolua_get_Achievement_Achievement_id,NULL);
3426 tolua_endmodule(tolua_S);
3427 tolua_cclass(tolua_S,"Action","Action","",NULL);
3428 tolua_beginmodule(tolua_S,"Action");
3429 tolua_variable(tolua_S,"id",tolua_get_Action_Action_id,NULL);
3430 tolua_endmodule(tolua_S);
3431 tolua_cclass(tolua_S,"Unit_List_Link","Unit_List_Link","",NULL);
3432 tolua_beginmodule(tolua_S,"Unit_List_Link");
3433 tolua_endmodule(tolua_S);
3434 tolua_cclass(tolua_S,"City_List_Link","City_List_Link","",NULL);
3435 tolua_beginmodule(tolua_S,"City_List_Link");
3436 tolua_endmodule(tolua_S);
3437 tolua_module(tolua_S,"game",0);
3438 tolua_beginmodule(tolua_S,"game");
3439 tolua_function(tolua_S,"turn",tolua_game_game_turn00);
3440 tolua_endmodule(tolua_S);
3441 tolua_module(tolua_S,"Player",0);
3442 tolua_beginmodule(tolua_S,"Player");
3443 tolua_module(tolua_S,"properties",0);
3444 tolua_beginmodule(tolua_S,"properties");
3445 tolua_function(tolua_S,"id",tolua_game_Player_properties_id00);
3446 tolua_endmodule(tolua_S);
3447 tolua_function(tolua_S,"num_cities",tolua_game_Player_num_cities00);
3448 tolua_function(tolua_S,"num_units",tolua_game_Player_num_units00);
3449 tolua_function(tolua_S,"has_wonder",tolua_game_Player_has_wonder00);
3450 tolua_function(tolua_S,"gold",tolua_game_Player_gold00);
3451 tolua_function(tolua_S,"knows_tech",tolua_game_Player_knows_tech00);
3452 tolua_function(tolua_S,"shares_research",tolua_game_Player_shares_research00);
3453 tolua_function(tolua_S,"research_rule_name",tolua_game_Player_research_rule_name00);
3454 tolua_function(tolua_S,"research_name_translation",tolua_game_Player_research_name_translation00);
3455 tolua_function(tolua_S,"culture",tolua_game_Player_culture00);
3456 tolua_endmodule(tolua_S);
3457 tolua_module(tolua_S,"methods_private",0);
3458 tolua_beginmodule(tolua_S,"methods_private");
3459 tolua_function(tolua_S,"list_players",tolua_game_methods_private_list_players00);
3460 tolua_module(tolua_S,"Player",0);
3461 tolua_beginmodule(tolua_S,"Player");
3462 tolua_function(tolua_S,"unit_list_head",tolua_game_methods_private_Player_unit_list_head00);
3463 tolua_function(tolua_S,"city_list_head",tolua_game_methods_private_Player_city_list_head00);
3464 tolua_endmodule(tolua_S);
3465 tolua_endmodule(tolua_S);
3466
3467 { /* begin embedded lua code */
3468 static unsigned char B[] = {
3469 10,102,117,110, 99,116,105,111,110, 32, 80,108, 97,121,101,
3470 114, 58,105,115, 95,104,117,109, 97,110, 40, 41, 10,114,101,
3471 116,117,114,110, 32,110,111,116, 32,115,101,108,102, 46, 97,
3472 105, 95, 99,111,110,116,114,111,108,108,101,100, 10,101,110,
3473 100, 10,102,117,110, 99,116,105,111,110, 32, 80,108, 97,121,
3474 101,114, 58,101,120,105,115,116,115, 40, 41, 10,114,101,116,
3475 117,114,110, 32,116,114,117,101, 10,101,110,100,32
3476 };
3477 if (luaL_loadbuffer(tolua_S,(char*)B,sizeof(B),"tolua: embedded Lua code") == LUA_OK)
3478 lua_pcall(tolua_S,0,LUA_MULTRET,0);
3479 } /* end of embedded lua code */
3480
3481 tolua_module(tolua_S,"City",0);
3482 tolua_beginmodule(tolua_S,"City");
3483 tolua_module(tolua_S,"properties",0);
3484 tolua_beginmodule(tolua_S,"properties");
3485 tolua_function(tolua_S,"size",tolua_game_City_properties_size00);
3486 tolua_function(tolua_S,"tile",tolua_game_City_properties_tile00);
3487 tolua_endmodule(tolua_S);
3488 tolua_function(tolua_S,"has_building",tolua_game_City_has_building00);
3489 tolua_function(tolua_S,"map_sq_radius",tolua_game_City_map_sq_radius00);
3490 tolua_function(tolua_S,"inspire_partisans",tolua_game_City_inspire_partisans00);
3491 tolua_function(tolua_S,"culture",tolua_game_City_culture00);
3492 tolua_function(tolua_S,"is_happy",tolua_game_City_is_happy00);
3493 tolua_function(tolua_S,"is_unhappy",tolua_game_City_is_unhappy00);
3494 tolua_function(tolua_S,"is_celebrating",tolua_game_City_is_celebrating00);
3495 tolua_function(tolua_S,"is_gov_center",tolua_game_City_is_gov_center00);
3496 tolua_function(tolua_S,"is_capital",tolua_game_City_is_capital00);
3497 tolua_endmodule(tolua_S);
3498
3499 { /* begin embedded lua code */
3500 static unsigned char B[] = {
3501 10,102,117,110, 99,116,105,111,110, 32, 67,105,116,121, 58,
3502 101,120,105,115,116,115, 40, 41, 10,114,101,116,117,114,110,
3503 32,116,114,117,101, 10,101,110,100,32
3504 };
3505 if (luaL_loadbuffer(tolua_S,(char*)B,sizeof(B),"tolua: embedded Lua code") == LUA_OK)
3506 lua_pcall(tolua_S,0,LUA_MULTRET,0);
3507 } /* end of embedded lua code */
3508
3509 tolua_module(tolua_S,"Unit",0);
3510 tolua_beginmodule(tolua_S,"Unit");
3511 tolua_module(tolua_S,"properties",0);
3512 tolua_beginmodule(tolua_S,"properties");
3513 tolua_function(tolua_S,"tile",tolua_game_Unit_properties_tile00);
3514 tolua_endmodule(tolua_S);
3515 tolua_function(tolua_S,"transporter",tolua_game_Unit_transporter00);
3516 tolua_function(tolua_S,"is_on_possible_city_tile",tolua_game_Unit_is_on_possible_city_tile00);
3517 tolua_function(tolua_S,"facing",tolua_game_Unit_facing00);
3518 tolua_endmodule(tolua_S);
3519 tolua_module(tolua_S,"methods_private",0);
3520 tolua_beginmodule(tolua_S,"methods_private");
3521 tolua_module(tolua_S,"Unit",0);
3522 tolua_beginmodule(tolua_S,"Unit");
3523 tolua_function(tolua_S,"cargo_list_head",tolua_game_methods_private_Unit_cargo_list_head00);
3524 tolua_endmodule(tolua_S);
3525 tolua_endmodule(tolua_S);
3526
3527 { /* begin embedded lua code */
3528 static unsigned char B[] = {
3529 10,102,117,110, 99,116,105,111,110, 32, 85,110,105,116, 58,
3530 101,120,105,115,116,115, 40, 41, 10,114,101,116,117,114,110,
3531 32,116,114,117,101, 10,101,110,100, 10,102,117,110, 99,116,
3532 105,111,110, 32, 85,110,105,116, 58,103,101,116, 95,104,111,
3533 109,101, 99,105,116,121, 40, 41, 10,114,101,116,117,114,110,
3534 32,102,105,110,100, 46, 99,105,116,121, 40,115,101,108,102,
3535 46,111,119,110,101,114, 44, 32,115,101,108,102, 46,104,111,
3536 109,101, 99,105,116,121, 41, 10,101,110,100,32
3537 };
3538 if (luaL_loadbuffer(tolua_S,(char*)B,sizeof(B),"tolua: embedded Lua code") == LUA_OK)
3539 lua_pcall(tolua_S,0,LUA_MULTRET,0);
3540 } /* end of embedded lua code */
3541
3542 tolua_module(tolua_S,"Tile",0);
3543 tolua_beginmodule(tolua_S,"Tile");
3544 tolua_module(tolua_S,"properties",0);
3545 tolua_beginmodule(tolua_S,"properties");
3546 tolua_function(tolua_S,"nat_x",tolua_game_Tile_properties_nat_x00);
3547 tolua_function(tolua_S,"nat_y",tolua_game_Tile_properties_nat_y00);
3548 tolua_function(tolua_S,"x",tolua_game_Tile_properties_x00);
3549 tolua_function(tolua_S,"y",tolua_game_Tile_properties_y00);
3550 tolua_endmodule(tolua_S);
3551 tolua_function(tolua_S,"city",tolua_game_Tile_city00);
3552 tolua_function(tolua_S,"city_exists_within_max_city_map",tolua_game_Tile_city_exists_within_max_city_map00);
3553 tolua_function(tolua_S,"has_extra",tolua_game_Tile_has_extra00);
3554 tolua_function(tolua_S,"has_base",tolua_game_Tile_has_base00);
3555 tolua_function(tolua_S,"has_road",tolua_game_Tile_has_road00);
3556 tolua_function(tolua_S,"num_units",tolua_game_Tile_num_units00);
3557 tolua_function(tolua_S,"sq_distance",tolua_game_Tile_sq_distance00);
3558 tolua_endmodule(tolua_S);
3559
3560 { /* begin embedded lua code */
3561 static unsigned char B[] = {
3562 10,102,117,110, 99,116,105,111,110, 32, 84,105,108,101, 58,
3563 99,105,116,121, 95,101,120,105,115,116,115, 95,119,105,116,
3564 104,105,110, 95, 99,105,116,121, 95,114, 97,100,105,117,115,
3565 40, 99,101,110,116,101,114, 41, 10,108,111,103, 46,100,101,
3566 112,114,101, 99, 97,116,105,111,110, 95,119, 97,114,110,105,
3567 110,103, 40, 34, 99,105,116,121, 95,101,120,105,115,116,115,
3568 95,119,105,116,104,105,110, 95, 99,105,116,121, 95,114, 97,
3569 100,105,117,115, 40, 41, 34, 44, 32, 34, 99,105,116,121, 95,
3570 101,120,105,115,116,115, 95,119,105,116,104,105,110, 95,109,
3571 97,120, 95, 99,105,116,121, 95,109, 97,112, 40, 41, 34, 44,
3572 10, 34, 50, 46, 51, 34, 41, 59, 10,114,101,116,117,114,110,
3573 32,115,101,108,102, 58, 99,105,116,121, 95,101,120,105,115,
3574 116,115, 95,119,105,116,104,105,110, 95,109, 97,120, 95, 99,
3575 105,116,121, 95,109, 97,112, 40, 99,101,110,116,101,114, 41,
3576 10,101,110,100,32
3577 };
3578 if (luaL_loadbuffer(tolua_S,(char*)B,sizeof(B),"tolua: embedded Lua code") == LUA_OK)
3579 lua_pcall(tolua_S,0,LUA_MULTRET,0);
3580 } /* end of embedded lua code */
3581
3582 tolua_module(tolua_S,"methods_private",0);
3583 tolua_beginmodule(tolua_S,"methods_private");
3584 tolua_module(tolua_S,"Tile",0);
3585 tolua_beginmodule(tolua_S,"Tile");
3586 tolua_function(tolua_S,"next_outward_index",tolua_game_methods_private_Tile_next_outward_index00);
3587 tolua_function(tolua_S,"tile_for_outward_index",tolua_game_methods_private_Tile_tile_for_outward_index00);
3588 tolua_function(tolua_S,"unit_list_head",tolua_game_methods_private_Tile_unit_list_head00);
3589 tolua_endmodule(tolua_S);
3590 tolua_endmodule(tolua_S);
3591 tolua_module(tolua_S,"Government",0);
3592 tolua_beginmodule(tolua_S,"Government");
3593 tolua_function(tolua_S,"rule_name",tolua_game_Government_rule_name00);
3594 tolua_function(tolua_S,"name_translation",tolua_game_Government_name_translation00);
3595 tolua_endmodule(tolua_S);
3596 tolua_module(tolua_S,"Nation_Type",0);
3597 tolua_beginmodule(tolua_S,"Nation_Type");
3598 tolua_function(tolua_S,"rule_name",tolua_game_Nation_Type_rule_name00);
3599 tolua_function(tolua_S,"name_translation",tolua_game_Nation_Type_name_translation00);
3600 tolua_function(tolua_S,"plural_translation",tolua_game_Nation_Type_plural_translation00);
3601 tolua_endmodule(tolua_S);
3602 tolua_module(tolua_S,"Building_Type",0);
3603 tolua_beginmodule(tolua_S,"Building_Type");
3604 tolua_function(tolua_S,"is_wonder",tolua_game_Building_Type_is_wonder00);
3605 tolua_function(tolua_S,"is_great_wonder",tolua_game_Building_Type_is_great_wonder00);
3606 tolua_function(tolua_S,"is_small_wonder",tolua_game_Building_Type_is_small_wonder00);
3607 tolua_function(tolua_S,"is_improvement",tolua_game_Building_Type_is_improvement00);
3608 tolua_function(tolua_S,"rule_name",tolua_game_Building_Type_rule_name00);
3609 tolua_function(tolua_S,"name_translation",tolua_game_Building_Type_name_translation00);
3610 tolua_endmodule(tolua_S);
3611
3612 { /* begin embedded lua code */
3613 static unsigned char B[] = {
3614 10,102,117,110, 99,116,105,111,110, 32, 66,117,105,108,100,
3615 105,110,103, 95, 84,121,112,101, 58, 98,117,105,108,100, 95,
3616 115,104,105,101,108,100, 95, 99,111,115,116, 40, 41, 10,114,
3617 101,116,117,114,110, 32,115,101,108,102, 46, 98,117,105,108,
3618 100, 95, 99,111,115,116, 10,101,110,100,32
3619 };
3620 if (luaL_loadbuffer(tolua_S,(char*)B,sizeof(B),"tolua: embedded Lua code") == LUA_OK)
3621 lua_pcall(tolua_S,0,LUA_MULTRET,0);
3622 } /* end of embedded lua code */
3623
3624 tolua_module(tolua_S,"Unit_Type",0);
3625 tolua_beginmodule(tolua_S,"Unit_Type");
3626 tolua_function(tolua_S,"has_flag",tolua_game_Unit_Type_has_flag00);
3627 tolua_function(tolua_S,"has_role",tolua_game_Unit_Type_has_role00);
3628 tolua_function(tolua_S,"rule_name",tolua_game_Unit_Type_rule_name00);
3629 tolua_function(tolua_S,"name_translation",tolua_game_Unit_Type_name_translation00);
3630 tolua_function(tolua_S,"can_exist_at_tile",tolua_game_Unit_Type_can_exist_at_tile00);
3631 tolua_endmodule(tolua_S);
3632
3633 { /* begin embedded lua code */
3634 static unsigned char B[] = {
3635 10,102,117,110, 99,116,105,111,110, 32, 85,110,105,116, 95,
3636 84,121,112,101, 58, 98,117,105,108,100, 95,115,104,105,101,
3637 108,100, 95, 99,111,115,116, 40, 41, 10,114,101,116,117,114,
3638 110, 32,115,101,108,102, 46, 98,117,105,108,100, 95, 99,111,
3639 115,116, 10,101,110,100,32
3640 };
3641 if (luaL_loadbuffer(tolua_S,(char*)B,sizeof(B),"tolua: embedded Lua code") == LUA_OK)
3642 lua_pcall(tolua_S,0,LUA_MULTRET,0);
3643 } /* end of embedded lua code */
3644
3645 tolua_module(tolua_S,"Tech_Type",0);
3646 tolua_beginmodule(tolua_S,"Tech_Type");
3647 tolua_function(tolua_S,"rule_name",tolua_game_Tech_Type_rule_name00);
3648 tolua_function(tolua_S,"name_translation",tolua_game_Tech_Type_name_translation00);
3649 tolua_endmodule(tolua_S);
3650 tolua_module(tolua_S,"Terrain",0);
3651 tolua_beginmodule(tolua_S,"Terrain");
3652 tolua_function(tolua_S,"rule_name",tolua_game_Terrain_rule_name00);
3653 tolua_function(tolua_S,"name_translation",tolua_game_Terrain_name_translation00);
3654 tolua_function(tolua_S,"class_name",tolua_game_Terrain_class_name00);
3655 tolua_endmodule(tolua_S);
3656 tolua_module(tolua_S,"Disaster",0);
3657 tolua_beginmodule(tolua_S,"Disaster");
3658 tolua_function(tolua_S,"rule_name",tolua_game_Disaster_rule_name00);
3659 tolua_function(tolua_S,"name_translation",tolua_game_Disaster_name_translation00);
3660 tolua_endmodule(tolua_S);
3661 tolua_module(tolua_S,"Achievement",0);
3662 tolua_beginmodule(tolua_S,"Achievement");
3663 tolua_function(tolua_S,"rule_name",tolua_game_Achievement_rule_name00);
3664 tolua_function(tolua_S,"name_translation",tolua_game_Achievement_name_translation00);
3665 tolua_endmodule(tolua_S);
3666 tolua_module(tolua_S,"Action",0);
3667 tolua_beginmodule(tolua_S,"Action");
3668 tolua_function(tolua_S,"rule_name",tolua_game_Action_rule_name00);
3669 tolua_function(tolua_S,"name_translation",tolua_game_Action_name_translation00);
3670 tolua_endmodule(tolua_S);
3671 tolua_module(tolua_S,"Unit_List_Link",0);
3672 tolua_beginmodule(tolua_S,"Unit_List_Link");
3673 tolua_function(tolua_S,"data",tolua_game_Unit_List_Link_data00);
3674 tolua_function(tolua_S,"next",tolua_game_Unit_List_Link_next00);
3675 tolua_endmodule(tolua_S);
3676 tolua_module(tolua_S,"City_List_Link",0);
3677 tolua_beginmodule(tolua_S,"City_List_Link");
3678 tolua_function(tolua_S,"data",tolua_game_City_List_Link_data00);
3679 tolua_function(tolua_S,"next",tolua_game_City_List_Link_next00);
3680 tolua_endmodule(tolua_S);
3681 tolua_module(tolua_S,"find",0);
3682 tolua_beginmodule(tolua_S,"find");
3683 tolua_function(tolua_S,"player",tolua_game_find_player00);
3684 tolua_function(tolua_S,"city",tolua_game_find_city00);
3685 tolua_function(tolua_S,"unit",tolua_game_find_unit00);
3686 tolua_function(tolua_S,"transport_unit",tolua_game_find_transport_unit00);
3687 tolua_function(tolua_S,"tile",tolua_game_find_tile00);
3688 tolua_function(tolua_S,"tile",tolua_game_find_tile01);
3689 tolua_function(tolua_S,"government",tolua_game_find_government00);
3690 tolua_function(tolua_S,"government",tolua_game_find_government01);
3691 tolua_function(tolua_S,"nation_type",tolua_game_find_nation_type00);
3692 tolua_function(tolua_S,"nation_type",tolua_game_find_nation_type01);
3693 tolua_function(tolua_S,"building_type",tolua_game_find_building_type00);
3694 tolua_function(tolua_S,"building_type",tolua_game_find_building_type01);
3695 tolua_function(tolua_S,"unit_type",tolua_game_find_unit_type00);
3696 tolua_function(tolua_S,"unit_type",tolua_game_find_unit_type01);
3697 tolua_function(tolua_S,"role_unit_type",tolua_game_find_role_unit_type00);
3698 tolua_function(tolua_S,"tech_type",tolua_game_find_tech_type00);
3699 tolua_function(tolua_S,"tech_type",tolua_game_find_tech_type01);
3700 tolua_function(tolua_S,"terrain",tolua_game_find_terrain00);
3701 tolua_function(tolua_S,"terrain",tolua_game_find_terrain01);
3702 tolua_function(tolua_S,"nonexistent",tolua_game_find_nonexistent00);
3703 tolua_endmodule(tolua_S);
3704 tolua_module(tolua_S,"E",0);
3705 tolua_beginmodule(tolua_S,"E");
3706 tolua_endmodule(tolua_S);
3707 tolua_module(tolua_S,"effects",0);
3708 tolua_beginmodule(tolua_S,"effects");
3709 tolua_function(tolua_S,"world_bonus",tolua_game_effects_world_bonus00);
3710 tolua_function(tolua_S,"player_bonus",tolua_game_effects_player_bonus00);
3711 tolua_function(tolua_S,"city_bonus",tolua_game_effects_city_bonus00);
3712 tolua_endmodule(tolua_S);
3713 tolua_module(tolua_S,"direction",0);
3714 tolua_beginmodule(tolua_S,"direction");
3715 tolua_function(tolua_S,"str2dir",tolua_game_direction_str2dir00);
3716 tolua_function(tolua_S,"next_ccw",tolua_game_direction_next_ccw00);
3717 tolua_function(tolua_S,"next_cw",tolua_game_direction_next_cw00);
3718 tolua_function(tolua_S,"opposite",tolua_game_direction_opposite00);
3719 tolua_endmodule(tolua_S);
3720
3721 { /* begin embedded lua code */
3722 static unsigned char B[] = {
3723 10,102,117,110, 99,116,105,111,110, 32,115,116,114, 50,100,
3724 105,114,101, 99,116,105,111,110, 40,115,116,114, 41, 10,114,
3725 101,116,117,114,110, 32,100,105,114,101, 99,116,105,111,110,
3726 46,115,116,114, 50,100,105,114, 40,115,116,114, 41, 10,101,
3727 110,100,32
3728 };
3729 if (luaL_loadbuffer(tolua_S,(char*)B,sizeof(B),"tolua: embedded Lua code") == LUA_OK)
3730 lua_pcall(tolua_S,0,LUA_MULTRET,0);
3731 } /* end of embedded lua code */
3732
3733
3734 { /* begin embedded lua code */
3735 static unsigned char B[] = {
3736 10,100,111, 10,108,111, 99, 97,108, 32,112,114,105,118, 97,
3737 116,101, 32, 61, 32,109,101,116,104,111,100,115, 95,112,114,
3738 105,118, 97,116,101, 10,108,111, 99, 97,108, 32,102,117,110,
3739 99,116,105,111,110, 32,118, 97,108,117,101, 95,105,116,101,
3740 114, 97,116,111,114, 40, 97,114,114, 97,121, 41, 10,108,111,
3741 99, 97,108, 32,105, 32, 61, 32, 48, 10,108,111, 99, 97,108,
3742 32,102,117,110, 99,116,105,111,110, 32,105,116,101,114, 97,
3743 116,111,114, 40, 41, 10,105, 32, 61, 32,105, 32, 43, 32, 49,
3744 10,114,101,116,117,114,110, 32, 97,114,114, 97,121, 91,105,
3745 93, 10,101,110,100, 10,114,101,116,117,114,110, 32,105,116,
3746 101,114, 97,116,111,114, 10,101,110,100, 10,108,111, 99, 97,
3747 108, 32,102,117,110, 99,116,105,111,110, 32,115, 97,102,101,
3748 95,105,116,101,114, 97,116,101, 95,108,105,115,116, 40,108,
3749 105,110,107, 41, 10,108,111, 99, 97,108, 32,111, 98,106,115,
3750 32, 61, 32,123,125, 10,119,104,105,108,101, 32,108,105,110,
3751 107, 32,100,111, 10,111, 98,106,115, 91, 35,111, 98,106,115,
3752 32, 43, 32, 49, 93, 32, 61, 32,108,105,110,107, 58,100, 97,
3753 116, 97, 40, 41, 10,108,105,110,107, 32, 61, 32,108,105,110,
3754 107, 58,110,101,120,116, 40, 41, 10,101,110,100, 10,114,101,
3755 116,117,114,110, 32,118, 97,108,117,101, 95,105,116,101,114,
3756 97,116,111,114, 40,111, 98,106,115, 41, 10,101,110,100, 10,
3757 102,117,110, 99,116,105,111,110, 32, 80,108, 97,121,101,114,
3758 58,117,110,105,116,115, 95,105,116,101,114, 97,116,101, 40,
3759 41, 10,114,101,116,117,114,110, 32,115, 97,102,101, 95,105,
3760 116,101,114, 97,116,101, 95,108,105,115,116, 40,112,114,105,
3761 118, 97,116,101, 46, 80,108, 97,121,101,114, 46,117,110,105,
3762 116, 95,108,105,115,116, 95,104,101, 97,100, 40,115,101,108,
3763 102, 41, 41, 10,101,110,100, 10,102,117,110, 99,116,105,111,
3764 110, 32, 80,108, 97,121,101,114, 58, 99,105,116,105,101,115,
3765 95,105,116,101,114, 97,116,101, 40, 41, 10,114,101,116,117,
3766 114,110, 32,115, 97,102,101, 95,105,116,101,114, 97,116,101,
3767 95,108,105,115,116, 40,112,114,105,118, 97,116,101, 46, 80,
3768 108, 97,121,101,114, 46, 99,105,116,121, 95,108,105,115,116,
3769 95,104,101, 97,100, 40,115,101,108,102, 41, 41, 10,101,110,
3770 100, 10,102,117,110, 99,116,105,111,110, 32, 84,105,108,101,
3771 58,117,110,105,116,115, 95,105,116,101,114, 97,116,101, 40,
3772 41, 10,114,101,116,117,114,110, 32,115, 97,102,101, 95,105,
3773 116,101,114, 97,116,101, 95,108,105,115,116, 40,112,114,105,
3774 118, 97,116,101, 46, 84,105,108,101, 46,117,110,105,116, 95,
3775 108,105,115,116, 95,104,101, 97,100, 40,115,101,108,102, 41,
3776 41, 10,101,110,100, 10,102,117,110, 99,116,105,111,110, 32,
3777 85,110,105,116, 58, 99, 97,114,103,111, 95,105,116,101,114,
3778 97,116,101, 40, 41, 10,114,101,116,117,114,110, 32,115, 97,
3779 102,101, 95,105,116,101,114, 97,116,101, 95,108,105,115,116,
3780 40,112,114,105,118, 97,116,101, 46, 85,110,105,116, 46, 99,
3781 97,114,103,111, 95,108,105,115,116, 95,104,101, 97,100, 40,
3782 115,101,108,102, 41, 41, 10,101,110,100, 10,101,110,100, 10,
3783 100,111, 10,108,111, 99, 97,108, 32,110,101,120,116, 95,111,
3784 117,116,119, 97,114,100, 95,105,110,100,101,120, 32, 61, 32,
3785 109,101,116,104,111,100,115, 95,112,114,105,118, 97,116,101,
3786 46, 84,105,108,101, 46,110,101,120,116, 95,111,117,116,119,
3787 97,114,100, 95,105,110,100,101,120, 10,108,111, 99, 97,108,
3788 32,116,105,108,101, 95,102,111,114, 95,111,117,116,119, 97,
3789 114,100, 95,105,110,100,101,120, 32, 61, 32,109,101,116,104,
3790 111,100,115, 95,112,114,105,118, 97,116,101, 46, 84,105,108,
3791 101, 46,116,105,108,101, 95,102,111,114, 95,111,117,116,119,
3792 97,114,100, 95,105,110,100,101,120, 10,102,117,110, 99,116,
3793 105,111,110, 32, 84,105,108,101, 58,115,113,117, 97,114,101,
3794 95,105,116,101,114, 97,116,101, 40,114, 97,100,105,117,115,
3795 41, 10,108,111, 99, 97,108, 32,105,110,100,101,120, 32, 61,
3796 32, 45, 49, 10,108,111, 99, 97,108, 32,102,117,110, 99,116,
3797 105,111,110, 32,105,116,101,114, 97,116,111,114, 40, 41, 10,
3798 105,110,100,101,120, 32, 61, 32,110,101,120,116, 95,111,117,
3799 116,119, 97,114,100, 95,105,110,100,101,120, 40,115,101,108,
3800 102, 44, 32,105,110,100,101,120, 44, 32,114, 97,100,105,117,
3801 115, 41, 10,105,102, 32,105,110,100,101,120, 32, 60, 32, 48,
3802 32,116,104,101,110, 10,114,101,116,117,114,110, 32,110,105,
3803 108, 10,101,108,115,101, 10,114,101,116,117,114,110, 32,116,
3804 105,108,101, 95,102,111,114, 95,111,117,116,119, 97,114,100,
3805 95,105,110,100,101,120, 40,115,101,108,102, 44, 32,105,110,
3806 100,101,120, 41, 10,101,110,100, 10,101,110,100, 10,114,101,
3807 116,117,114,110, 32,105,116,101,114, 97,116,111,114, 10,101,
3808 110,100, 10,102,117,110, 99,116,105,111,110, 32, 84,105,108,
3809 101, 58, 99,105,114, 99,108,101, 95,105,116,101,114, 97,116,
3810 101, 40,115,113, 95,114, 97,100,105,117,115, 41, 10,108,111,
3811 99, 97,108, 32, 99,114, 95,114, 97,100,105,117,115, 32, 61,
3812 32,109, 97,116,104, 46,102,108,111,111,114, 40,109, 97,116,
3813 104, 46,115,113,114,116, 40,115,113, 95,114, 97,100,105,117,
3814 115, 41, 41, 10,108,111, 99, 97,108, 32,115,113, 95,105,116,
3815 101,114, 32, 61, 32,115,101,108,102, 58,115,113,117, 97,114,
3816 101, 95,105,116,101,114, 97,116,101, 40, 99,114, 95,114, 97,
3817 100,105,117,115, 41, 10,108,111, 99, 97,108, 32,102,117,110,
3818 99,116,105,111,110, 32,105,116,101,114, 97,116,111,114, 40,
3819 41, 10,108,111, 99, 97,108, 32,116,105,108,101, 32, 61, 32,
3820 110,105,108, 10,114,101,112,101, 97,116, 10,116,105,108,101,
3821 32, 61, 32,115,113, 95,105,116,101,114, 40, 41, 10,117,110,
3822 116,105,108, 32,110,111,116, 32,116,105,108,101, 32,111,114,
3823 32,115,101,108,102, 58,115,113, 95,100,105,115,116, 97,110,
3824 99,101, 40,116,105,108,101, 41, 32, 60, 61, 32,115,113, 95,
3825 114, 97,100,105,117,115, 10,114,101,116,117,114,110, 32,116,
3826 105,108,101, 10,101,110,100, 10,114,101,116,117,114,110, 32,
3827 105,116,101,114, 97,116,111,114, 10,101,110,100, 10,101,110,
3828 100,32
3829 };
3830 if (luaL_loadbuffer(tolua_S,(char*)B,sizeof(B),"tolua: embedded Lua code") == LUA_OK)
3831 lua_pcall(tolua_S,0,LUA_MULTRET,0);
3832 } /* end of embedded lua code */
3833
3834
3835 { /* begin embedded lua code */
3836 static unsigned char B[] = {
3837 10,100,111, 10,108,111, 99, 97,108, 32,102,117,110, 99,116,
3838 105,111,110, 32,105,110,100,101,120, 95,105,116,101,114, 97,
3839 116,101, 40,108,111,111,107,117,112, 41, 10,108,111, 99, 97,
3840 108, 32,105,110,100,101,120, 32, 61, 32, 45, 49, 10,108,111,
3841 99, 97,108, 32,102,117,110, 99,116,105,111,110, 32,105,116,
3842 101,114, 97,116,111,114, 40, 41, 10,105,110,100,101,120, 32,
3843 61, 32,105,110,100,101,120, 32, 43, 32, 49, 10,114,101,116,
3844 117,114,110, 32,108,111,111,107,117,112, 40,105,110,100,101,
3845 120, 41, 10,101,110,100, 10,114,101,116,117,114,110, 32,105,
3846 116,101,114, 97,116,111,114, 10,101,110,100, 10,108,111, 99,
3847 97,108, 32,108,105,115,116,112, 32, 61, 32,109,101,116,104,
3848 111,100,115, 95,112,114,105,118, 97,116,101, 46,108,105,115,
3849 116, 95,112,108, 97,121,101,114,115, 10,102,117,110, 99,116,
3850 105,111,110, 32,112,108, 97,121,101,114,115, 95,105,116,101,
3851 114, 97,116,101, 40, 41, 10,108,111, 99, 97,108, 32,112,108,
3852 105,115,116, 32, 61, 32,108,105,115,116,112, 40, 41, 10,108,
3853 111, 99, 97,108, 32,105,110,100,101,120, 32, 61, 32, 48, 10,
3854 114,101,116,117,114,110, 32,102,117,110, 99,116,105,111,110,
3855 40, 41, 10,105,110,100,101,120, 32, 61, 32,105,110,100,101,
3856 120, 32, 43, 32, 49, 10,114,101,116,117,114,110, 32,112,108,
3857 105,115,116, 91,105,110,100,101,120, 93, 10,101,110,100, 10,
3858 101,110,100, 10,102,117,110, 99,116,105,111,110, 32,119,104,
3859 111,108,101, 95,109, 97,112, 95,105,116,101,114, 97,116,101,
3860 40, 41, 10,114,101,116,117,114,110, 32,105,110,100,101,120,
3861 95,105,116,101,114, 97,116,101, 40,102,105,110,100, 46,116,
3862 105,108,101, 41, 10,101,110,100, 10,101,110,100,32
3863 };
3864 if (luaL_loadbuffer(tolua_S,(char*)B,sizeof(B),"tolua: embedded Lua code") == LUA_OK)
3865 lua_pcall(tolua_S,0,LUA_MULTRET,0);
3866 } /* end of embedded lua code */
3867
3868 tolua_endmodule(tolua_S);
3869 return 1;
3870 }
3871 /* Open tolua function */
tolua_game_open(lua_State * tolua_S)3872 TOLUA_API int tolua_game_open (lua_State* tolua_S)
3873 {
3874 lua_pushcfunction(tolua_S, luaopen_game);
3875 lua_pushstring(tolua_S, "game");
3876 lua_call(tolua_S, 1, 0);
3877 return 1;
3878 }
3879