Freeciv-3.3
Loading...
Searching...
No Matches
Functions
api_game_find.c File Reference
#include "counters.h"
#include "idex.h"
#include "map.h"
#include "movement.h"
#include "luascript.h"
#include "api_game_find.h"

Go to the source code of this file.

Functions

Playerapi_find_player_by_name (lua_State *L, const char *name)
 
Playerapi_find_player (lua_State *L, int player_id)
 
Cityapi_find_city (lua_State *L, Player *pplayer, int city_id)
 
Unitapi_find_unit (lua_State *L, Player *pplayer, int unit_id)
 
Unitapi_find_transport_unit (lua_State *L, Player *pplayer, Unit_Type *ptype, Tile *ptile)
 
Unit_Typeapi_find_role_unit_type (lua_State *L, const char *role_name, Player *pplayer)
 
Tileapi_find_tile (lua_State *L, int nat_x, int nat_y)
 
Tileapi_find_tile_by_index (lua_State *L, int tindex)
 
Governmentapi_find_government (lua_State *L, int government_id)
 
Governmentapi_find_government_by_name (lua_State *L, const char *name_orig)
 
Nation_Typeapi_find_nation_type (lua_State *L, int nation_type_id)
 
Nation_Typeapi_find_nation_type_by_name (lua_State *L, const char *name_orig)
 
Actionapi_find_action (lua_State *L, action_id act_id)
 
Actionapi_find_action_by_name (lua_State *L, const char *name_orig)
 
Building_Typeapi_find_building_type (lua_State *L, int building_type_id)
 
Building_Typeapi_find_building_type_by_name (lua_State *L, const char *name_orig)
 
Unit_Typeapi_find_unit_type (lua_State *L, int unit_type_id)
 
Unit_Typeapi_find_unit_type_by_name (lua_State *L, const char *name_orig)
 
Tech_Typeapi_find_tech_type (lua_State *L, int tech_type_id)
 
Tech_Typeapi_find_tech_type_by_name (lua_State *L, const char *name_orig)
 
Terrainapi_find_terrain (lua_State *L, int terrain_id)
 
Terrainapi_find_terrain_by_name (lua_State *L, const char *name_orig)
 
Achievementapi_find_achievement (lua_State *L, int achievement_id)
 
Achievementapi_find_achievement_by_name (lua_State *L, const char *name_orig)
 
Disasterapi_find_disaster (lua_State *L, int disaster_id)
 
Disasterapi_find_disaster_by_name (lua_State *L, const char *name_orig)
 
const Directionapi_find_direction (lua_State *L, int id)
 
Actionapi_find_action_type_by_id (lua_State *L, int id)
 
Actionapi_find_action_type_by_name (lua_State *L, const char *name)
 
Counterapi_find_counter (lua_State *L, int counter_id)
 
Counterapi_find_counter_by_name (lua_State *L, const char *name)
 
Nonexistentapi_find_nonexistent (lua_State *L)
 

Function Documentation

◆ api_find_achievement()

Achievement * api_find_achievement ( lua_State L,
int  achievement_id 
)

Return the achievement with the given achievement_id index.

Definition at line 303 of file api_game_find.c.

Referenced by tolua_game_find_achievement01().

◆ api_find_achievement_by_name()

Achievement * api_find_achievement_by_name ( lua_State L,
const char name_orig 
)

Return the achievement with the given name_orig.

Definition at line 313 of file api_game_find.c.

Referenced by tolua_game_find_achievement00().

◆ 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 196 of file api_game_find.c.

Referenced by tolua_game_find_action01().

◆ 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 206 of file api_game_find.c.

Referenced by tolua_game_find_action00().

◆ api_find_action_type_by_id()

Action * api_find_action_type_by_id ( lua_State L,
int  id 
)

Returns the action with the specified id.

Definition at line 355 of file api_game_find.c.

Referenced by tolua_game_find_action03().

◆ api_find_action_type_by_name()

Action * api_find_action_type_by_name ( lua_State L,
const char name 
)

Returns the action with the specified name.

Definition at line 365 of file api_game_find.c.

Referenced by tolua_game_find_action02().

◆ 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 218 of file api_game_find.c.

Referenced by tolua_game_find_building_type01().

◆ 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 228 of file api_game_find.c.

Referenced by tolua_game_find_building_type00().

◆ 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 52 of file api_game_find.c.

Referenced by tolua_game_find_city00().

◆ api_find_counter()

Counter * api_find_counter ( lua_State L,
int  counter_id 
)

Returns the counter specified by id.

Definition at line 376 of file api_game_find.c.

Referenced by tolua_game_find_counter01().

◆ api_find_counter_by_name()

Counter * api_find_counter_by_name ( lua_State L,
const char name 
)

Returns the counter specified by name.

Definition at line 386 of file api_game_find.c.

Referenced by tolua_game_find_counter00().

◆ api_find_direction()

const Direction * api_find_direction ( lua_State L,
int  id 
)

Return the direction with the given id

Definition at line 345 of file api_game_find.c.

Referenced by tolua_game_find_direction01().

◆ api_find_disaster()

Disaster * api_find_disaster ( lua_State L,
int  disaster_id 
)

Return the disaster with the given disaster_id index.

Definition at line 324 of file api_game_find.c.

Referenced by tolua_game_find_disaster00().

◆ api_find_disaster_by_name()

Disaster * api_find_disaster_by_name ( lua_State L,
const char name_orig 
)

Return the disaster with the given name_orig.

Definition at line 334 of file api_game_find.c.

Referenced by tolua_game_find_achievement02().

◆ 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 152 of file api_game_find.c.

Referenced by tolua_game_find_government01().

◆ 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 162 of file api_game_find.c.

Referenced by tolua_game_find_government00().

◆ 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 174 of file api_game_find.c.

Referenced by tolua_game_find_nation_type01().

◆ 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 184 of file api_game_find.c.

Referenced by tolua_game_find_nation_type00().

◆ api_find_nonexistent()

Nonexistent * api_find_nonexistent ( lua_State L)

Return a dummy pointer.

Definition at line 397 of file api_game_find.c.

Referenced by tolua_game_find_nonexistent00().

◆ api_find_player()

Player * api_find_player ( lua_State L,
int  player_id 
)

Return a player with the given player_id.

Definition at line 42 of file api_game_find.c.

Referenced by tolua_game_find_player01().

◆ api_find_player_by_name()

Player * api_find_player_by_name ( lua_State L,
const char name 
)

Return a player with the given name

Definition at line 32 of file api_game_find.c.

Referenced by tolua_game_find_player00().

◆ 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 103 of file api_game_find.c.

Referenced by tolua_game_find_role_unit_type00().

◆ 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 261 of file api_game_find.c.

Referenced by tolua_game_find_tech_type01().

◆ 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 271 of file api_game_find.c.

Referenced by tolua_game_find_tech_type00().

◆ 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 282 of file api_game_find.c.

Referenced by tolua_game_find_terrain01().

◆ 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 292 of file api_game_find.c.

Referenced by tolua_game_find_terrain00().

◆ 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 132 of file api_game_find.c.

Referenced by tolua_game_find_tile00().

◆ 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 142 of file api_game_find.c.

Referenced by tolua_game_find_tile01().

◆ 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 80 of file api_game_find.c.

Referenced by tolua_game_find_transport_unit00().

◆ 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 66 of file api_game_find.c.

Referenced by tolua_game_find_unit00().

◆ 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 240 of file api_game_find.c.

Referenced by tolua_game_find_unit_type01().

◆ 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 250 of file api_game_find.c.

Referenced by tolua_game_find_unit_type00().