73 struct unit *ptransport;
95 role_or_flag = unit_role_id_by_name(role_name,
fc_strcasecmp);
97 if (!unit_role_id_is_valid(unit_role_id(role_or_flag))) {
98 role_or_flag = unit_type_flag_id_by_name(role_name,
fc_strcasecmp);
99 if (!unit_type_flag_id_is_valid(unit_type_flag_id(role_or_flag))) {
168 const char *name_orig)
211 const char *name_orig)
287 static const char *p =
"";
struct action * action_by_rule_name(const char *name)
Return the action with the given name.
struct action * action_by_number(action_id act_id)
Return the action with the given id.
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.
struct government * government_by_number(const Government_type_id gov)
Return the government with the given index.
struct government * government_by_rule_name(const char *name)
Returns the government that has the given (untranslated) rule name.
struct unit * idex_lookup_unit(struct world *iworld, int id)
Lookup unit with given id.
struct city * idex_lookup_city(struct world *iworld, int id)
Lookup city with given id.
struct impr_type * improvement_by_rule_name(const char *name)
Does a linear search of improvement_types[].name.vernacular Returns nullptr when none match.
struct impr_type * improvement_by_number(const Impr_type_id id)
Returns the improvement type for the given index/ID.
#define LUASCRIPT_CHECK_STATE(L,...)
#define LUASCRIPT_CHECK_ARG_NIL(L, value, narg, type,...)
struct tile * native_pos_to_tile(const struct civ_map *nmap, int nat_x, int nat_y)
Return the tile for the given native position.
struct tile * index_to_tile(const struct civ_map *imap, int mindex)
Return the tile for the given index position.
struct nation_type * nation_by_number(const Nation_type_id nation)
Return the nation with the given index.
struct nation_type * nation_by_rule_name(const char *name)
Returns the nation that has the given (untranslated) rule name (adjective).
struct unit * player_unit_by_number(const struct player *pplayer, int unit_id)
If the specified player owns the unit with the specified id, return pointer to the unit struct.
struct player * player_by_number(const int player_id)
Return struct player pointer for the given player index.
struct city * player_city_by_number(const struct player *pplayer, int city_id)
If the specified player owns the city with the specified id, return pointer to the city struct.
int fc_strcasecmp(const char *str0, const char *str1)
Compare strings like strcmp(), but ignoring case.
struct advance * advance_by_rule_name(const char *name)
Does a linear search of advances[].name.vernacular Returns nullptr when none match.
struct advance * advance_by_number(const Tech_type_id atype)
Return the advance for the given advance index.
struct terrain * terrain_by_number(const Terrain_type_id type)
Return the terrain for the given terrain index.
struct terrain * terrain_by_rule_name(const char *name)
Return the terrain type matching the name, or T_UNKNOWN if none matches.
struct unit * transporter_for_unit(const struct unit *pcargo)
Find the best transporter at the given location for the unit.
void unit_virtual_destroy(struct unit *punit)
Free the memory used by virtual unit.
struct unit * unit_virtual_create(struct player *pplayer, struct city *pcity, const struct unit_type *punittype, int veteran_level)
Create a virtual unit skeleton.
void unit_tile_set(struct unit *punit, struct tile *ptile)
Set the tile location of the unit.
struct unit_type * utype_by_number(const Unit_type_id id)
Return a pointer for the unit type struct for the given unit type id.
struct unit_type * best_role_unit_for_player(const struct player *pplayer, int role)
Return "best" unit the player can build, with given role/flag.
int num_role_units(int role)
How many unit types have specified role/flag.
struct unit_type * unit_type_by_rule_name(const char *name)
Returns the unit type that has the given (untranslated) rule name.
struct unit_type * get_role_unit(int role, int role_index)
Return index-th unit with specified role/flag.