Freeciv21
Develop your civilization from humble roots to a global empire
api_game_find.cpp File Reference
#include "fcintl.h"
#include "idex.h"
#include "map.h"
#include "luascript.h"
#include "api_game_find.h"
+ Include dependency graph for api_game_find.cpp:

Go to the source code of this file.

Functions

Playerapi_find_player (lua_State *L, int player_id)
 Return a player with the given player_id. More...
 
Cityapi_find_city (lua_State *L, Player *pplayer, int city_id)
 Return a player city with the given city_id. More...
 
Unitapi_find_unit (lua_State *L, Player *pplayer, int unit_id)
 Return a player unit with the given unit_id. More...
 
Unitapi_find_transport_unit (lua_State *L, Player *pplayer, Unit_Type *ptype, Tile *ptile)
 Return a unit that can transport ptype at a given ptile. More...
 
Unit_Typeapi_find_role_unit_type (lua_State *L, const char *role_name, Player *pplayer)
 Return a unit type for given role or flag. More...
 
Tileapi_find_tile (lua_State *L, int nat_x, int nat_y)
 Return the tile at the given native coordinates. More...
 
Tileapi_find_tile_by_index (lua_State *L, int tindex)
 Return the tile at the given index. More...
 
Governmentapi_find_government (lua_State *L, int government_id)
 Return the government with the given Government_type_id index. More...
 
Governmentapi_find_government_by_name (lua_State *L, const char *name_orig)
 Return the governmet with the given name_orig. More...
 
Nation_Typeapi_find_nation_type (lua_State *L, int nation_type_id)
 Return the nation type with the given nation_type_id index. More...
 
Nation_Typeapi_find_nation_type_by_name (lua_State *L, const char *name_orig)
 Return the nation type with the given name_orig. More...
 
Actionapi_find_action (lua_State *L, action_id act_id)
 Return the action type with the given action_id number. More...
 
Actionapi_find_action_by_name (lua_State *L, const char *name_orig)
 Return the action with the given name_orig. More...
 
Building_Typeapi_find_building_type (lua_State *L, int building_type_id)
 Return the improvement type with the given impr_type_id index. More...
 
Building_Typeapi_find_building_type_by_name (lua_State *L, const char *name_orig)
 Return the improvement type with the given name_orig. More...
 
Unit_Typeapi_find_unit_type (lua_State *L, int unit_type_id)
 Return the unit type with the given unit_type_id index. More...
 
Unit_Typeapi_find_unit_type_by_name (lua_State *L, const char *name_orig)
 Return the unit type with the given name_orig. More...
 
Tech_Typeapi_find_tech_type (lua_State *L, int tech_type_id)
 Return the tech type with the given tech_type_id index. More...
 
Tech_Typeapi_find_tech_type_by_name (lua_State *L, const char *name_orig)
 Return the tech type with the given name_orig. More...
 
Terrainapi_find_terrain (lua_State *L, int terrain_id)
 Return the terrain with the given terrain_id index. More...
 
Terrainapi_find_terrain_by_name (lua_State *L, const char *name_orig)
 Return the terrain with the given name_orig. More...
 
Nonexistentapi_find_nonexistent (lua_State *L)
 Return a dummy pointer. More...
 

Function Documentation

◆ api_find_action()

Action* api_find_action ( lua_State *  L,
action_id  act_id 
)

Return the action type with the given action_id number.

Definition at line 179 of file api_game_find.cpp.

◆ api_find_action_by_name()

Action* api_find_action_by_name ( lua_State *  L,
const char *  name_orig 
)

Return the action with the given name_orig.

Definition at line 189 of file api_game_find.cpp.

◆ api_find_building_type()

Building_Type* api_find_building_type ( lua_State *  L,
int  building_type_id 
)

Return the improvement type with the given impr_type_id index.

Definition at line 200 of file api_game_find.cpp.

◆ api_find_building_type_by_name()

Building_Type* api_find_building_type_by_name ( lua_State *  L,
const char *  name_orig 
)

Return the improvement type with the given name_orig.

Definition at line 210 of file api_game_find.cpp.

◆ api_find_city()

City* api_find_city ( lua_State *  L,
Player pplayer,
int  city_id 
)

Return a player city with the given city_id.

Definition at line 36 of file api_game_find.cpp.

◆ api_find_government()

Government* api_find_government ( lua_State *  L,
int  government_id 
)

Return the government with the given Government_type_id index.

Definition at line 136 of file api_game_find.cpp.

◆ api_find_government_by_name()

Government* api_find_government_by_name ( lua_State *  L,
const char *  name_orig 
)

Return the governmet with the given name_orig.

Definition at line 146 of file api_game_find.cpp.

◆ api_find_nation_type()

Nation_Type* api_find_nation_type ( lua_State *  L,
int  nation_type_id 
)

Return the nation type with the given nation_type_id index.

Definition at line 157 of file api_game_find.cpp.

◆ api_find_nation_type_by_name()

Nation_Type* api_find_nation_type_by_name ( lua_State *  L,
const char *  name_orig 
)

Return the nation type with the given name_orig.

Definition at line 167 of file api_game_find.cpp.

◆ api_find_nonexistent()

Nonexistent* api_find_nonexistent ( lua_State *  L)

Return a dummy pointer.

Definition at line 285 of file api_game_find.cpp.

◆ api_find_player()

Player* api_find_player ( lua_State *  L,
int  player_id 
)

Return a player with the given player_id.

Definition at line 26 of file api_game_find.cpp.

◆ api_find_role_unit_type()

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.

(Prior to 2.6.0, this worked only for roles.)

Definition at line 87 of file api_game_find.cpp.

◆ api_find_tech_type()

Tech_Type* api_find_tech_type ( lua_State *  L,
int  tech_type_id 
)

Return the tech type with the given tech_type_id index.

Definition at line 243 of file api_game_find.cpp.

◆ api_find_tech_type_by_name()

Tech_Type* api_find_tech_type_by_name ( lua_State *  L,
const char *  name_orig 
)

Return the tech type with the given name_orig.

Definition at line 253 of file api_game_find.cpp.

◆ api_find_terrain()

Terrain* api_find_terrain ( lua_State *  L,
int  terrain_id 
)

Return the terrain with the given terrain_id index.

Definition at line 264 of file api_game_find.cpp.

◆ api_find_terrain_by_name()

Terrain* api_find_terrain_by_name ( lua_State *  L,
const char *  name_orig 
)

Return the terrain with the given name_orig.

Definition at line 274 of file api_game_find.cpp.

◆ api_find_tile()

Tile* api_find_tile ( lua_State *  L,
int  nat_x,
int  nat_y 
)

Return the tile at the given native coordinates.

Definition at line 116 of file api_game_find.cpp.

◆ api_find_tile_by_index()

Tile* api_find_tile_by_index ( lua_State *  L,
int  tindex 
)

Return the tile at the given index.

Definition at line 126 of file api_game_find.cpp.

◆ api_find_transport_unit()

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.

Definition at line 64 of file api_game_find.cpp.

◆ api_find_unit()

Unit* api_find_unit ( lua_State *  L,
Player pplayer,
int  unit_id 
)

Return a player unit with the given unit_id.

Definition at line 50 of file api_game_find.cpp.

◆ api_find_unit_type()

Unit_Type* api_find_unit_type ( lua_State *  L,
int  unit_type_id 
)

Return the unit type with the given unit_type_id index.

Definition at line 222 of file api_game_find.cpp.

◆ api_find_unit_type_by_name()

Unit_Type* api_find_unit_type_by_name ( lua_State *  L,
const char *  name_orig 
)

Return the unit type with the given name_orig.

Definition at line 232 of file api_game_find.cpp.