Freeciv21
Develop your civilization from humble roots to a global empire
api_game_find.h
Go to the documentation of this file.
1 /**************************************************************************
2  Copyright (c) 1996-2020 Freeciv21 and Freeciv contributors. This file is
3  part of Freeciv21. Freeciv21 is free software: you can redistribute it
4  and/or modify it under the terms of the GNU General Public License as
5  published by the Free Software Foundation, either version 3 of the
6  License, or (at your option) any later version. You should have received
7  a copy of the GNU General Public License along with Freeciv21. If not,
8  see https://www.gnu.org/licenses/.
9 **************************************************************************/
10 #pragma once
11 
12 /* dependencies/lua */
13 #include "lua.h"
14 
15 /* common/scriptcore */
16 #include "luascript_types.h"
17 
18 // Object find module.
19 Player *api_find_player(lua_State *L, int player_id);
20 
21 City *api_find_city(lua_State *L, Player *pplayer, int city_id);
22 
23 Unit *api_find_unit(lua_State *L, Player *pplayer, int unit_id);
24 Unit *api_find_transport_unit(lua_State *L, Player *pplayer,
25  Unit_Type *ptype, Tile *ptile);
26 Tile *api_find_tile(lua_State *L, int nat_x, int nat_y);
27 Tile *api_find_tile_by_index(lua_State *L, int tindex);
28 
29 Government *api_find_government(lua_State *L, int government_id);
30 Government *api_find_government_by_name(lua_State *L, const char *name_orig);
31 
32 Nation_Type *api_find_nation_type(lua_State *L, int nation_type_id);
34  const char *name_orig);
35 Action *api_find_action(lua_State *L, action_id act_id);
36 Action *api_find_action_by_name(lua_State *L, const char *name_orig);
37 Building_Type *api_find_building_type(lua_State *L, int building_type_id);
39  const char *name_orig);
40 Unit_Type *api_find_unit_type(lua_State *L, int unit_type_id);
41 Unit_Type *api_find_unit_type_by_name(lua_State *L, const char *name_orig);
42 Unit_Type *api_find_role_unit_type(lua_State *L, const char *role_name,
43  Player *pplayer);
44 Tech_Type *api_find_tech_type(lua_State *L, int tech_type_id);
45 Tech_Type *api_find_tech_type_by_name(lua_State *L, const char *name_orig);
46 
47 Terrain *api_find_terrain(lua_State *L, int terrain_id);
48 Terrain *api_find_terrain_by_name(lua_State *L, const char *name_orig);
49 
50 Nonexistent *api_find_nonexistent(lua_State *L);
Building_Type * api_find_building_type_by_name(lua_State *L, const char *name_orig)
Return the improvement type with the given name_orig.
Unit_Type * api_find_role_unit_type(lua_State *L, const char *role_name, Player *pplayer)
Return a unit type for given role or flag.
Unit_Type * api_find_unit_type_by_name(lua_State *L, const char *name_orig)
Return the unit type with the given name_orig.
Nation_Type * api_find_nation_type_by_name(lua_State *L, const char *name_orig)
Return the nation type with the given name_orig.
Terrain * api_find_terrain(lua_State *L, int terrain_id)
Return the terrain with the given terrain_id index.
Terrain * api_find_terrain_by_name(lua_State *L, const char *name_orig)
Return the terrain with the given name_orig.
Action * api_find_action_by_name(lua_State *L, const char *name_orig)
Return the action with the given name_orig.
Tile * api_find_tile_by_index(lua_State *L, int tindex)
Return the tile at the given index.
Building_Type * api_find_building_type(lua_State *L, int building_type_id)
Return the improvement type with the given impr_type_id index.
Nation_Type * api_find_nation_type(lua_State *L, int nation_type_id)
Return the nation type with the given nation_type_id index.
Government * api_find_government_by_name(lua_State *L, const char *name_orig)
Return the governmet with the given name_orig.
Unit * api_find_unit(lua_State *L, Player *pplayer, int unit_id)
Return a player unit with the given unit_id.
Government * api_find_government(lua_State *L, int government_id)
Return the government with the given Government_type_id index.
Unit * api_find_transport_unit(lua_State *L, Player *pplayer, Unit_Type *ptype, Tile *ptile)
Return a unit that can transport ptype at a given ptile.
Tech_Type * api_find_tech_type(lua_State *L, int tech_type_id)
Return the tech type with the given tech_type_id index.
Tech_Type * api_find_tech_type_by_name(lua_State *L, const char *name_orig)
Return the tech type with the given name_orig.
Player * api_find_player(lua_State *L, int player_id)
Return a player with the given player_id.
City * api_find_city(lua_State *L, Player *pplayer, int city_id)
Return a player city with the given city_id.
Action * api_find_action(lua_State *L, action_id act_id)
Return the action type with the given action_id number.
Unit_Type * api_find_unit_type(lua_State *L, int unit_type_id)
Return the unit type with the given unit_type_id index.
Tile * api_find_tile(lua_State *L, int nat_x, int nat_y)
Return the tile at the given native coordinates.
Nonexistent * api_find_nonexistent(lua_State *L)
Return a dummy pointer.
int action_id
Definition: fc_types.h:306
void Nonexistent
#define nat_x
#define nat_y
Definition: tech.h:113
Definition: city.h:291
Definition: player.h:231
Definition: tile.h:42
Definition: unit.h:134