Freeciv-3.1: /fast/freeciv/nightly/S3_1/common/scriptcore/api_game_find.h File Reference

Freeciv-3.1

Loading...
Searching...
No Matches
Functions
api_game_find.h File Reference
`#include "lua.h"`
`#include "luascript_types.h"`

Go to the source code of this file.

## Functions

Player * | api_find_player_by_name (lua_State *L, const char *name)
Player * | api_find_player (lua_State *L, int player_id)
City * | api_find_city (lua_State *L, Player *pplayer, int city_id)
Unit * | api_find_unit (lua_State *L, Player *pplayer, int unit_id)
Unit * | api_find_transport_unit (lua_State *L, Player *pplayer, Unit_Type *ptype, Tile *ptile)
Tile * | api_find_tile (lua_State *L, int nat_x, int nat_y)
Tile * | api_find_tile_by_index (lua_State *L, int tindex)
Government * | api_find_government (lua_State *L, int government_id)
Government * | api_find_government_by_name (lua_State *L, const char *name_orig)
Nation_Type * | api_find_nation_type (lua_State *L, int nation_type_id)
Nation_Type * | api_find_nation_type_by_name (lua_State *L, const char *name_orig)
Action * | api_find_action (lua_State *L, action_id act_id)
Action * | api_find_action_by_name (lua_State *L, const char *name_orig)
Building_Type * | api_find_building_type (lua_State *L, int building_type_id)
Building_Type * | api_find_building_type_by_name (lua_State *L, const char *name_orig)
Unit_Type * | api_find_unit_type (lua_State *L, int unit_type_id)
Unit_Type * | api_find_unit_type_by_name (lua_State *L, const char *name_orig)
Unit_Type * | api_find_role_unit_type (lua_State *L, const char *role_name, Player *pplayer)
Tech_Type * | api_find_tech_type (lua_State *L, int tech_type_id)
Tech_Type * | api_find_tech_type_by_name (lua_State *L, const char *name_orig)
Terrain * | api_find_terrain (lua_State *L, int terrain_id)
Terrain * | api_find_terrain_by_name (lua_State *L, const char *name_orig)
Achievement * | api_find_achievement (lua_State *L, int achievement_id)
Achievement * | api_find_achievement_by_name (lua_State *L, const char *name_orig)
Disaster * | api_find_disaster (lua_State *L, int disaster_id)
Disaster * | api_find_disaster_by_name (lua_State *L, const char *name_orig)
const Direction * | api_find_direction (lua_State *L, int id)
Action * | api_find_action_type_by_id (lua_State *L, int id)
Action * | api_find_action_type_by_name (lua_State *L, const char *name)
Nonexistent * | api_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 302 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 312 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 195 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 205 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 354 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 364 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 217 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 227 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 51 of file api_game_find.c.

Referenced by tolua_game_find_city00().

## ◆ api_find_direction()

const Direction * api_find_direction | ( | lua_State * | L,
|  | int | id
| ) |  |

Return the direction with the given id

Definition at line 344 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 323 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 333 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 151 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 161 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 173 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 183 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 375 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 41 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 31 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 102 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 260 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 270 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 281 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 291 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 131 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 141 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 79 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 65 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 239 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 249 of file api_game_find.c.

Referenced by tolua_game_find_unit_type00().