Freeciv-3.1
Loading...
Searching...
No Matches
Functions
api_game_methods.c File Reference
#include "deprecations.h"
#include "achievements.h"
#include "actions.h"
#include "calendar.h"
#include "citizens.h"
#include "culture.h"
#include "featured_text.h"
#include "game.h"
#include "government.h"
#include "improvement.h"
#include "map.h"
#include "movement.h"
#include "nation.h"
#include "research.h"
#include "tech.h"
#include "terrain.h"
#include "tile.h"
#include "unitlist.h"
#include "unittype.h"
#include "luascript.h"
#include "api_game_methods.h"

Go to the source code of this file.

Functions

int api_methods_game_turn (lua_State *L)
 
int api_methods_game_year (lua_State *L)
 
int api_methods_game_year_fragment (lua_State *L)
 
const char * api_methods_game_year_text (lua_State *L)
 
int api_methods_game_turn_deprecated (lua_State *L)
 
const char * api_methods_game_rulesetdir (lua_State *L)
 
const char * api_methods_game_ruleset_name (lua_State *L)
 
bool api_methods_building_type_is_wonder (lua_State *L, Building_Type *pbuilding)
 
bool api_methods_building_type_is_great_wonder (lua_State *L, Building_Type *pbuilding)
 
bool api_methods_building_type_is_small_wonder (lua_State *L, Building_Type *pbuilding)
 
bool api_methods_building_type_is_improvement (lua_State *L, Building_Type *pbuilding)
 
const char * api_methods_building_type_rule_name (lua_State *L, Building_Type *pbuilding)
 
const char * api_methods_building_type_name_translation (lua_State *L, Building_Type *pbuilding)
 
bool api_methods_city_has_building (lua_State *L, City *pcity, Building_Type *building)
 
int api_methods_city_map_sq_radius (lua_State *L, City *pcity)
 
int api_methods_city_size_get (lua_State *L, City *pcity)
 
Tileapi_methods_city_tile_get (lua_State *L, City *pcity)
 
int api_methods_city_inspire_partisans (lua_State *L, City *self, Player *inspirer)
 
int api_methods_city_culture_get (lua_State *L, City *pcity)
 
bool api_methods_is_city_happy (lua_State *L, City *pcity)
 
bool api_methods_is_city_unhappy (lua_State *L, City *pcity)
 
bool api_methods_is_city_celebrating (lua_State *L, City *pcity)
 
bool api_methods_is_gov_center (lua_State *L, City *pcity)
 
bool api_methods_is_capital (lua_State *L, City *pcity)
 
bool api_methods_is_primary_capital (lua_State *L, City *pcity)
 
const char * api_methods_government_rule_name (lua_State *L, Government *pgovernment)
 
const char * api_methods_government_name_translation (lua_State *L, Government *pgovernment)
 
const char * api_methods_nation_type_rule_name (lua_State *L, Nation_Type *pnation)
 
const char * api_methods_nation_type_name_translation (lua_State *L, Nation_Type *pnation)
 
const char * api_methods_nation_type_plural_translation (lua_State *L, Nation_Type *pnation)
 
const char * api_methods_player_controlling_gui (lua_State *L, Player *pplayer)
 
bool api_methods_player_has_wonder (lua_State *L, Player *pplayer, Building_Type *building)
 
int api_methods_player_number (lua_State *L, Player *pplayer)
 
int api_methods_player_num_cities (lua_State *L, Player *pplayer)
 
int api_methods_player_num_units (lua_State *L, Player *pplayer)
 
int api_methods_player_gold (lua_State *L, Player *pplayer)
 
bool api_methods_player_knows_tech (lua_State *L, Player *pplayer, Tech_Type *ptech)
 
int api_methods_player_culture_get (lua_State *L, Player *pplayer)
 
bool api_methods_player_has_flag (lua_State *L, Player *pplayer, const char *flag)
 
Unit_Typeapi_methods_player_can_upgrade (lua_State *L, Player *pplayer, Unit_Type *utype)
 
bool api_methods_player_can_build_unit_direct (lua_State *L, Player *pplayer, Unit_Type *utype)
 
bool api_methods_player_can_build_impr_direct (lua_State *L, Player *pplayer, Building_Type *itype)
 
bool api_methods_unit_can_upgrade (lua_State *L, Unit *punit, bool is_free)
 
const char * api_methods_unit_transform_problem (lua_State *L, Unit *punit, Unit_Type *ptype)
 
bool api_methods_player_shares_research (lua_State *L, Player *pplayer, Player *aplayer)
 
const char * api_methods_research_rule_name (lua_State *L, Player *pplayer)
 
const char * api_methods_research_name_translation (lua_State *L, Player *pplayer)
 
lua_Object api_methods_private_list_players (lua_State *L)
 
Unit_List_Linkapi_methods_private_player_unit_list_head (lua_State *L, Player *pplayer)
 
City_List_Linkapi_methods_private_player_city_list_head (lua_State *L, Player *pplayer)
 
const char * api_methods_tech_type_rule_name (lua_State *L, Tech_Type *ptech)
 
const char * api_methods_tech_type_name_translation (lua_State *L, Tech_Type *ptech)
 
const char * api_methods_terrain_rule_name (lua_State *L, Terrain *pterrain)
 
const char * api_methods_terrain_name_translation (lua_State *L, Terrain *pterrain)
 
const char * api_methods_terrain_class_name (lua_State *L, Terrain *pterrain)
 
const char * api_methods_disaster_rule_name (lua_State *L, Disaster *pdis)
 
const char * api_methods_disaster_name_translation (lua_State *L, Disaster *pdis)
 
const char * api_methods_achievement_rule_name (lua_State *L, Achievement *pach)
 
const char * api_methods_achievement_name_translation (lua_State *L, Achievement *pach)
 
const char * api_methods_action_rule_name (lua_State *L, Action *pact)
 
const char * api_methods_action_name_translation (lua_State *L, Action *pact)
 
const char * api_methods_action_target_kind (lua_State *L, Action *pact)
 
int api_methods_tile_nat_x (lua_State *L, Tile *ptile)
 
int api_methods_tile_nat_y (lua_State *L, Tile *ptile)
 
int api_methods_tile_map_x (lua_State *L, Tile *ptile)
 
int api_methods_tile_map_y (lua_State *L, Tile *ptile)
 
Cityapi_methods_tile_city (lua_State *L, Tile *ptile)
 
bool api_methods_tile_city_exists_within_max_city_map (lua_State *L, Tile *ptile, bool may_be_on_center)
 
bool api_methods_tile_has_extra (lua_State *L, Tile *ptile, const char *name)
 
bool api_methods_tile_has_base (lua_State *L, Tile *ptile, const char *name)
 
bool api_methods_tile_has_road (lua_State *L, Tile *ptile, const char *name)
 
Playerapi_methods_tile_extra_owner (lua_State *L, Tile *ptile, const char *extra_name)
 
bool api_methods_enemy_tile (lua_State *L, Tile *ptile, Player *against)
 
int api_methods_tile_num_units (lua_State *L, Tile *ptile)
 
Unit_List_Linkapi_methods_private_tile_unit_list_head (lua_State *L, Tile *ptile)
 
int api_methods_private_tile_next_outward_index (lua_State *L, Tile *pstart, int tindex, int max_dist)
 
Tileapi_methods_private_tile_for_outward_index (lua_State *L, Tile *pstart, int tindex)
 
int api_methods_tile_sq_distance (lua_State *L, Tile *ptile1, Tile *ptile2)
 
bool api_methods_unit_city_can_be_built_here (lua_State *L, Unit *punit)
 
Tileapi_methods_unit_tile_get (lua_State *L, Unit *punit)
 
const Directionapi_methods_unit_orientation_get (lua_State *L, Unit *punit)
 
Unitapi_methods_unit_transporter (lua_State *L, Unit *punit)
 
Unit_List_Linkapi_methods_private_unit_cargo_list_head (lua_State *L, Unit *punit)
 
bool api_methods_unit_type_has_flag (lua_State *L, Unit_Type *punit_type, const char *flag)
 
bool api_methods_unit_type_has_role (lua_State *L, Unit_Type *punit_type, const char *role)
 
bool api_methods_unit_type_can_exist_at_tile (lua_State *L, Unit_Type *punit_type, Tile *ptile)
 
const char * api_methods_unit_type_rule_name (lua_State *L, Unit_Type *punit_type)
 
const char * api_methods_unit_type_name_translation (lua_State *L, Unit_Type *punit_type)
 
Unitapi_methods_unit_list_link_data (lua_State *L, Unit_List_Link *ul_link)
 
Unit_List_Linkapi_methods_unit_list_next_link (lua_State *L, Unit_List_Link *ul_link)
 
Cityapi_methods_city_list_link_data (lua_State *L, City_List_Link *cl_link)
 
City_List_Linkapi_methods_city_list_next_link (lua_State *L, City_List_Link *cl_link)
 
const char * api_methods_tile_link (lua_State *L, Tile *ptile)
 
const char * api_methods_unit_tile_link (lua_State *L, Unit *punit)
 
const char * api_methods_city_tile_link (lua_State *L, City *pcity)
 
const char * api_methods_unit_link (lua_State *L, Unit *punit)
 
const char * api_methods_city_link (lua_State *L, City *pcity)
 

Function Documentation

◆ api_methods_achievement_name_translation()

const char * api_methods_achievement_name_translation ( lua_State *  L,
Achievement pach 
)

Return translated name for Achievement

Definition at line 814 of file api_game_methods.c.

Referenced by tolua_game_Achievement_name_translation00().

◆ api_methods_achievement_rule_name()

const char * api_methods_achievement_rule_name ( lua_State *  L,
Achievement pach 
)

Return rule name for Achievement

Definition at line 802 of file api_game_methods.c.

Referenced by tolua_game_Achievement_rule_name00().

◆ api_methods_action_name_translation()

const char * api_methods_action_name_translation ( lua_State *  L,
Action pact 
)

Return translated name for Action

Definition at line 837 of file api_game_methods.c.

Referenced by tolua_game_Action_name_translation00().

◆ api_methods_action_rule_name()

const char * api_methods_action_rule_name ( lua_State *  L,
Action pact 
)

Return rule name for Action

Definition at line 826 of file api_game_methods.c.

Referenced by tolua_game_Action_rule_name00().

◆ api_methods_action_target_kind()

const char * api_methods_action_target_kind ( lua_State *  L,
Action pact 
)

Return target kind for Action

Definition at line 848 of file api_game_methods.c.

Referenced by tolua_game_Action_target_kind00().

◆ api_methods_building_type_is_great_wonder()

bool api_methods_building_type_is_great_wonder ( lua_State *  L,
Building_Type pbuilding 
)

Return TRUE if pbuilding is a great wonder.

Definition at line 135 of file api_game_methods.c.

Referenced by tolua_game_Building_Type_is_great_wonder00().

◆ api_methods_building_type_is_improvement()

bool api_methods_building_type_is_improvement ( lua_State *  L,
Building_Type pbuilding 
)

Return TRUE if pbuilding is a building.

Definition at line 159 of file api_game_methods.c.

Referenced by tolua_game_Building_Type_is_improvement00().

◆ api_methods_building_type_is_small_wonder()

bool api_methods_building_type_is_small_wonder ( lua_State *  L,
Building_Type pbuilding 
)

Return TRUE if pbuilding is a small wonder.

Definition at line 147 of file api_game_methods.c.

Referenced by tolua_game_Building_Type_is_small_wonder00().

◆ api_methods_building_type_is_wonder()

bool api_methods_building_type_is_wonder ( lua_State *  L,
Building_Type pbuilding 
)

Return TRUE if pbuilding is a wonder.

Definition at line 123 of file api_game_methods.c.

Referenced by tolua_game_Building_Type_is_wonder00().

◆ api_methods_building_type_name_translation()

const char * api_methods_building_type_name_translation ( lua_State *  L,
Building_Type pbuilding 
)

Return translated name for Building_Type

Definition at line 184 of file api_game_methods.c.

Referenced by tolua_game_Building_Type_name_translation00().

◆ api_methods_building_type_rule_name()

const char * api_methods_building_type_rule_name ( lua_State *  L,
Building_Type pbuilding 
)

Return rule name for Building_Type

Definition at line 171 of file api_game_methods.c.

Referenced by tolua_game_Building_Type_rule_name00().

◆ api_methods_city_culture_get()

int api_methods_city_culture_get ( lua_State *  L,
City pcity 
)

How much culture city has?

Definition at line 285 of file api_game_methods.c.

Referenced by tolua_game_City_culture00().

◆ api_methods_city_has_building()

bool api_methods_city_has_building ( lua_State *  L,
City pcity,
Building_Type building 
)

Return TRUE iff city has building

Definition at line 196 of file api_game_methods.c.

Referenced by tolua_game_City_has_building00().

◆ api_methods_city_inspire_partisans()

int api_methods_city_inspire_partisans ( lua_State *  L,
City self,
Player inspirer 
)

How much city inspires partisans for a player.

Definition at line 242 of file api_game_methods.c.

Referenced by tolua_game_City_inspire_partisans00().

◆ api_methods_city_link()

const char * api_methods_city_link ( lua_State *  L,
City pcity 
)

Return featured text link of the city.

Definition at line 1402 of file api_game_methods.c.

Referenced by tolua_game_City_link_text00().

◆ api_methods_city_list_link_data()

City * api_methods_city_list_link_data ( lua_State *  L,
City_List_Link cl_link 
)

Return City for list link

Definition at line 1336 of file api_game_methods.c.

Referenced by tolua_game_City_List_Link_data00().

◆ api_methods_city_list_next_link()

City_List_Link * api_methods_city_list_next_link ( lua_State *  L,
City_List_Link cl_link 
)

Return next list link or NULL when link is the last link

Definition at line 1347 of file api_game_methods.c.

Referenced by tolua_game_City_List_Link_next00().

◆ api_methods_city_map_sq_radius()

int api_methods_city_map_sq_radius ( lua_State *  L,
City pcity 
)

Return the square raduis of the city map.

Definition at line 209 of file api_game_methods.c.

Referenced by tolua_game_City_map_sq_radius00().

◆ api_methods_city_size_get()

int api_methods_city_size_get ( lua_State *  L,
City pcity 
)

Return the size of the city.

Definition at line 220 of file api_game_methods.c.

Referenced by tolua_game_City_properties_size00().

◆ api_methods_city_tile_get()

Tile * api_methods_city_tile_get ( lua_State *  L,
City pcity 
)

Return the tile of the city.

Definition at line 231 of file api_game_methods.c.

Referenced by tolua_game_City_properties_tile00().

◆ api_methods_city_tile_link()

const char * api_methods_city_tile_link ( lua_State *  L,
City pcity 
)

Return featured text link of the city tile.

Definition at line 1380 of file api_game_methods.c.

Referenced by tolua_game_City_tile_link_text00().

◆ api_methods_disaster_name_translation()

const char * api_methods_disaster_name_translation ( lua_State *  L,
Disaster pdis 
)

Return translated name for Disaster

Definition at line 790 of file api_game_methods.c.

Referenced by tolua_game_Disaster_name_translation00().

◆ api_methods_disaster_rule_name()

const char * api_methods_disaster_rule_name ( lua_State *  L,
Disaster pdis 
)

Return rule name for Disaster

Definition at line 779 of file api_game_methods.c.

Referenced by tolua_game_Disaster_rule_name00().

◆ api_methods_enemy_tile()

bool api_methods_enemy_tile ( lua_State *  L,
Tile ptile,
Player against 
)

Is tile occupied by enemies

Definition at line 1049 of file api_game_methods.c.

Referenced by tolua_game_Tile_is_enemy00().

◆ api_methods_game_ruleset_name()

const char * api_methods_game_ruleset_name ( lua_State *  L)

Return name of the current ruleset.

Definition at line 115 of file api_game_methods.c.

Referenced by tolua_game_game_ruleset_name00().

◆ api_methods_game_rulesetdir()

const char * api_methods_game_rulesetdir ( lua_State *  L)

Return name of the current ruleset.

Definition at line 107 of file api_game_methods.c.

Referenced by tolua_game_game_rulesetdir00().

◆ api_methods_game_turn()

int api_methods_game_turn ( lua_State *  L)

Return the current turn.

Definition at line 50 of file api_game_methods.c.

Referenced by tolua_game_game_current_turn00().

◆ api_methods_game_turn_deprecated()

int api_methods_game_turn_deprecated ( lua_State *  L)

Return the current turn, as if real turns started from 0.

Definition at line 90 of file api_game_methods.c.

Referenced by tolua_game_game_turn00().

◆ api_methods_game_year()

int api_methods_game_year ( lua_State *  L)

Return the current year.

Definition at line 60 of file api_game_methods.c.

Referenced by tolua_game_game_current_year00().

◆ api_methods_game_year_fragment()

int api_methods_game_year_fragment ( lua_State *  L)

Return the current year fragment.

Definition at line 70 of file api_game_methods.c.

Referenced by tolua_game_game_current_fragment00().

◆ api_methods_game_year_text()

const char * api_methods_game_year_text ( lua_State *  L)

Return textual representation of the current calendar time.

Definition at line 80 of file api_game_methods.c.

Referenced by tolua_game_game_current_year_text00().

◆ api_methods_government_name_translation()

const char * api_methods_government_name_translation ( lua_State *  L,
Government pgovernment 
)

Return translated name for Government

Definition at line 376 of file api_game_methods.c.

Referenced by tolua_game_Government_name_translation00().

◆ api_methods_government_rule_name()

const char * api_methods_government_rule_name ( lua_State *  L,
Government pgovernment 
)

Return rule name for Government

Definition at line 364 of file api_game_methods.c.

Referenced by tolua_game_Government_rule_name00().

◆ api_methods_is_capital()

bool api_methods_is_capital ( lua_State *  L,
City pcity 
)

Return TRUE if city is capital

Definition at line 342 of file api_game_methods.c.

Referenced by tolua_game_City_is_capital00().

◆ api_methods_is_city_celebrating()

bool api_methods_is_city_celebrating ( lua_State *  L,
City pcity 
)

Return TRUE iff city is celebrating

Definition at line 320 of file api_game_methods.c.

Referenced by tolua_game_City_is_celebrating00().

◆ api_methods_is_city_happy()

bool api_methods_is_city_happy ( lua_State *  L,
City pcity 
)

Return TRUE iff city happy

Definition at line 296 of file api_game_methods.c.

Referenced by tolua_game_City_is_happy00().

◆ api_methods_is_city_unhappy()

bool api_methods_is_city_unhappy ( lua_State *  L,
City pcity 
)

Return TRUE iff city is unhappy

Definition at line 308 of file api_game_methods.c.

Referenced by tolua_game_City_is_unhappy00().

◆ api_methods_is_gov_center()

bool api_methods_is_gov_center ( lua_State *  L,
City pcity 
)

Return TRUE iff city is government center

Definition at line 331 of file api_game_methods.c.

Referenced by tolua_game_City_is_gov_center00().

◆ api_methods_is_primary_capital()

bool api_methods_is_primary_capital ( lua_State *  L,
City pcity 
)

Return TRUE if city is primary capital

Definition at line 353 of file api_game_methods.c.

Referenced by tolua_game_City_is_primary_capital00().

◆ api_methods_nation_type_name_translation()

const char * api_methods_nation_type_name_translation ( lua_State *  L,
Nation_Type pnation 
)

Return translated adjective for Nation_Type

Definition at line 400 of file api_game_methods.c.

Referenced by tolua_game_Nation_Type_name_translation00().

◆ api_methods_nation_type_plural_translation()

const char * api_methods_nation_type_plural_translation ( lua_State *  L,
Nation_Type pnation 
)

Return translated plural noun for Nation_Type

Definition at line 412 of file api_game_methods.c.

Referenced by tolua_game_Nation_Type_plural_translation00().

◆ api_methods_nation_type_rule_name()

const char * api_methods_nation_type_rule_name ( lua_State *  L,
Nation_Type pnation 
)

Return rule name for Nation_Type

Definition at line 388 of file api_game_methods.c.

Referenced by tolua_game_Nation_Type_rule_name00().

◆ api_methods_player_can_build_impr_direct()

bool api_methods_player_can_build_impr_direct ( lua_State *  L,
Player pplayer,
Building_Type itype 
)

Certain tests if pplayer generally can build itype buildings.

Definition at line 579 of file api_game_methods.c.

Referenced by tolua_game_Player_can_build_direct00().

◆ api_methods_player_can_build_unit_direct()

bool api_methods_player_can_build_unit_direct ( lua_State *  L,
Player pplayer,
Unit_Type utype 
)

Certain tests if pplayer generally can build utype units, maybe after building a required improvement. Does not consider obsoletion.

Definition at line 566 of file api_game_methods.c.

Referenced by tolua_game_Player_can_build_direct01().

◆ api_methods_player_can_upgrade()

Unit_Type * api_methods_player_can_upgrade ( lua_State *  L,
Player pplayer,
Unit_Type utype 
)

Return a unit type the player potentially can upgrade utype to, or nil if the player can't upgrade it

Definition at line 552 of file api_game_methods.c.

Referenced by tolua_game_Player_can_upgrade00().

◆ api_methods_player_controlling_gui()

const char * api_methods_player_controlling_gui ( lua_State *  L,
Player pplayer 
)

Return gui type string of the controlling connection.

Definition at line 424 of file api_game_methods.c.

Referenced by tolua_game_Player_controlling_gui00().

◆ api_methods_player_culture_get()

int api_methods_player_culture_get ( lua_State *  L,
Player pplayer 
)

How much culture player has?

Definition at line 520 of file api_game_methods.c.

Referenced by tolua_game_Player_culture00().

◆ api_methods_player_gold()

int api_methods_player_gold ( lua_State *  L,
Player pplayer 
)

Return gold for Player

Definition at line 495 of file api_game_methods.c.

Referenced by tolua_game_Player_gold00().

◆ api_methods_player_has_flag()

bool api_methods_player_has_flag ( lua_State *  L,
Player pplayer,
const char *  flag 
)

Does player have flag set?

Definition at line 531 of file api_game_methods.c.

Referenced by tolua_game_Player_has_flag00().

◆ api_methods_player_has_wonder()

bool api_methods_player_has_wonder ( lua_State *  L,
Player pplayer,
Building_Type building 
)

Return TRUE iff player has wonder

Definition at line 449 of file api_game_methods.c.

Referenced by tolua_game_Player_has_wonder00().

◆ api_methods_player_knows_tech()

bool api_methods_player_knows_tech ( lua_State *  L,
Player pplayer,
Tech_Type ptech 
)

Return TRUE if Player knows advance ptech.

Definition at line 506 of file api_game_methods.c.

Referenced by tolua_game_Player_knows_tech00().

◆ api_methods_player_num_cities()

int api_methods_player_num_cities ( lua_State *  L,
Player pplayer 
)

Return the number of cities pplayer has.

Definition at line 473 of file api_game_methods.c.

Referenced by tolua_game_Player_num_cities00().

◆ api_methods_player_num_units()

int api_methods_player_num_units ( lua_State *  L,
Player pplayer 
)

Return the number of units pplayer has.

Definition at line 484 of file api_game_methods.c.

Referenced by tolua_game_Player_num_units00().

◆ api_methods_player_number()

int api_methods_player_number ( lua_State *  L,
Player pplayer 
)

Return player number

Definition at line 462 of file api_game_methods.c.

Referenced by tolua_game_Player_properties_id00().

◆ api_methods_player_shares_research()

bool api_methods_player_shares_research ( lua_State *  L,
Player pplayer,
Player aplayer 
)

Return TRUE if players share research.

Definition at line 641 of file api_game_methods.c.

Referenced by tolua_game_Player_shares_research00().

◆ api_methods_private_list_players()

lua_Object api_methods_private_list_players ( lua_State *  L)

Return Lua list of all players FIXME: safe function, no reason to hide

Definition at line 682 of file api_game_methods.c.

Referenced by tolua_game_methods_private_list_players00().

◆ api_methods_private_player_city_list_head()

City_List_Link * api_methods_private_player_city_list_head ( lua_State *  L,
Player pplayer 
)

Return list head for city list for Player

Definition at line 710 of file api_game_methods.c.

Referenced by tolua_game_methods_private_Player_city_list_head00().

◆ api_methods_private_player_unit_list_head()

Unit_List_Link * api_methods_private_player_unit_list_head ( lua_State *  L,
Player pplayer 
)

Return list head for unit list for Player

Definition at line 699 of file api_game_methods.c.

Referenced by tolua_game_methods_private_Player_unit_list_head00().

◆ api_methods_private_tile_for_outward_index()

Tile * api_methods_private_tile_for_outward_index ( lua_State *  L,
Tile pstart,
int  tindex 
)

Return tile for nth iteration index (for internal use)

Definition at line 1134 of file api_game_methods.c.

Referenced by tolua_game_methods_private_Tile_tile_for_outward_index00().

◆ api_methods_private_tile_next_outward_index()

int api_methods_private_tile_next_outward_index ( lua_State *  L,
Tile pstart,
int  tindex,
int  max_dist 
)

Return nth tile iteration index (for internal use) Will return the next index, or an index < 0 when done

Definition at line 1095 of file api_game_methods.c.

Referenced by tolua_game_methods_private_Tile_next_outward_index00().

◆ api_methods_private_tile_unit_list_head()

Unit_List_Link * api_methods_private_tile_unit_list_head ( lua_State *  L,
Tile ptile 
)

Return list head for unit list for Tile

Definition at line 1082 of file api_game_methods.c.

Referenced by tolua_game_methods_private_Tile_unit_list_head00().

◆ api_methods_private_unit_cargo_list_head()

Unit_List_Link * api_methods_private_unit_cargo_list_head ( lua_State *  L,
Unit punit 
)

Return list head for cargo list for Unit

Definition at line 1222 of file api_game_methods.c.

Referenced by tolua_game_methods_private_Unit_cargo_list_head00().

◆ api_methods_research_name_translation()

const char * api_methods_research_name_translation ( lua_State *  L,
Player pplayer 
)

Return name of the research group player belongs to.

Definition at line 665 of file api_game_methods.c.

Referenced by tolua_game_Player_research_name_translation00().

◆ api_methods_research_rule_name()

const char * api_methods_research_rule_name ( lua_State *  L,
Player pplayer 
)

Return name of the research group player belongs to.

Definition at line 654 of file api_game_methods.c.

Referenced by tolua_game_Player_research_rule_name00().

◆ api_methods_tech_type_name_translation()

const char * api_methods_tech_type_name_translation ( lua_State *  L,
Tech_Type ptech 
)

Return translated name for Tech_Type

Definition at line 733 of file api_game_methods.c.

Referenced by tolua_game_Tech_Type_name_translation00().

◆ api_methods_tech_type_rule_name()

const char * api_methods_tech_type_rule_name ( lua_State *  L,
Tech_Type ptech 
)

Return rule name for Tech_Type

Definition at line 722 of file api_game_methods.c.

Referenced by tolua_game_Tech_Type_rule_name00().

◆ api_methods_terrain_class_name()

const char * api_methods_terrain_class_name ( lua_State *  L,
Terrain pterrain 
)

Return name of the terrain's class

Definition at line 768 of file api_game_methods.c.

Referenced by tolua_game_Terrain_class_name00().

◆ api_methods_terrain_name_translation()

const char * api_methods_terrain_name_translation ( lua_State *  L,
Terrain pterrain 
)

Return translated name for Terrain

Definition at line 756 of file api_game_methods.c.

Referenced by tolua_game_Terrain_name_translation00().

◆ api_methods_terrain_rule_name()

const char * api_methods_terrain_rule_name ( lua_State *  L,
Terrain pterrain 
)

Return rule name for Terrain

Definition at line 745 of file api_game_methods.c.

Referenced by tolua_game_Terrain_rule_name00().

◆ api_methods_tile_city()

City * api_methods_tile_city ( lua_State *  L,
Tile ptile 
)

Return City on ptile, else NULL

Definition at line 908 of file api_game_methods.c.

Referenced by tolua_game_Tile_city00().

◆ api_methods_tile_city_exists_within_max_city_map()

bool api_methods_tile_city_exists_within_max_city_map ( lua_State *  L,
Tile ptile,
bool  may_be_on_center 
)

Return TRUE if there is a city inside the maximum city radius from ptile.

Definition at line 919 of file api_game_methods.c.

Referenced by tolua_game_Tile_city_exists_within_max_city_map00().

◆ api_methods_tile_extra_owner()

Player * api_methods_tile_extra_owner ( lua_State *  L,
Tile ptile,
const char *  extra_name 
)

Return the extra owner for the specified extra on ptile or NULL if the extra isn't there. If no name is specified the owner of the first owned extra at the tile is returned.

Definition at line 1016 of file api_game_methods.c.

Referenced by tolua_game_Tile_extra_owner00().

◆ api_methods_tile_has_base()

bool api_methods_tile_has_base ( lua_State *  L,
Tile ptile,
const char *  name 
)

Return TRUE if there is a base with rule name name on ptile. If no name is specified return true if there is any base on ptile.

Definition at line 960 of file api_game_methods.c.

Referenced by tolua_game_Tile_has_base00().

◆ api_methods_tile_has_extra()

bool api_methods_tile_has_extra ( lua_State *  L,
Tile ptile,
const char *  name 
)

Return TRUE if there is a extra with rule name name on ptile. If no name is specified return true if there is a extra on ptile.

Definition at line 933 of file api_game_methods.c.

Referenced by tolua_game_Tile_has_extra00().

◆ api_methods_tile_has_road()

bool api_methods_tile_has_road ( lua_State *  L,
Tile ptile,
const char *  name 
)

Return TRUE if there is a road with rule name name on ptile. If no name is specified return true if there is any road on ptile.

Definition at line 987 of file api_game_methods.c.

Referenced by tolua_game_Tile_has_road00().

◆ api_methods_tile_link()

const char * api_methods_tile_link ( lua_State *  L,
Tile ptile 
)

Return featured text link of the tile.

Definition at line 1358 of file api_game_methods.c.

Referenced by tolua_game_Tile_link_text00().

◆ api_methods_tile_map_x()

int api_methods_tile_map_x ( lua_State *  L,
Tile ptile 
)

Return the map x coordinate of the tile.

Definition at line 886 of file api_game_methods.c.

Referenced by tolua_game_Tile_properties_x00().

◆ api_methods_tile_map_y()

int api_methods_tile_map_y ( lua_State *  L,
Tile ptile 
)

Return the map y coordinate of the tile.

Definition at line 897 of file api_game_methods.c.

Referenced by tolua_game_Tile_properties_y00().

◆ api_methods_tile_nat_x()

int api_methods_tile_nat_x ( lua_State *  L,
Tile ptile 
)

Return the native x coordinate of the tile.

Definition at line 864 of file api_game_methods.c.

Referenced by tolua_game_Tile_properties_nat_x00().

◆ api_methods_tile_nat_y()

int api_methods_tile_nat_y ( lua_State *  L,
Tile ptile 
)

Return the native y coordinate of the tile.

Definition at line 875 of file api_game_methods.c.

Referenced by tolua_game_Tile_properties_nat_y00().

◆ api_methods_tile_num_units()

int api_methods_tile_num_units ( lua_State *  L,
Tile ptile 
)

Return number of units on tile

Definition at line 1071 of file api_game_methods.c.

Referenced by tolua_game_Tile_num_units00().

◆ api_methods_tile_sq_distance()

int api_methods_tile_sq_distance ( lua_State *  L,
Tile ptile1,
Tile ptile2 
)

Return squared distance between tiles 1 and 2

Definition at line 1159 of file api_game_methods.c.

Referenced by tolua_game_Tile_sq_distance00().

◆ api_methods_unit_can_upgrade()

bool api_methods_unit_can_upgrade ( lua_State *  L,
Unit punit,
bool  is_free 
)

Return if a unit can upgrade considering where it is now. If is_free is FALSE, considers local city and the owner's treasury.

Definition at line 594 of file api_game_methods.c.

Referenced by tolua_game_Unit_can_upgrade00().

◆ api_methods_unit_city_can_be_built_here()

bool api_methods_unit_city_can_be_built_here ( lua_State *  L,
Unit punit 
)

Can punit found a city on its tile?

FIXME: Unlike name suggests, this is currently used for finding cities from huts and the like, and is not suitable for checking if specified unit could act to build a city.

Definition at line 1175 of file api_game_methods.c.

Referenced by tolua_game_Unit_is_on_possible_city_tile00().

◆ api_methods_unit_link()

const char * api_methods_unit_link ( lua_State *  L,
Unit punit 
)

Return featured text link of the unit.

Definition at line 1391 of file api_game_methods.c.

Referenced by tolua_game_Unit_link_text00().

◆ api_methods_unit_list_link_data()

Unit * api_methods_unit_list_link_data ( lua_State *  L,
Unit_List_Link ul_link 
)

Return Unit for list link

Definition at line 1314 of file api_game_methods.c.

Referenced by tolua_game_Unit_List_Link_data00().

◆ api_methods_unit_list_next_link()

Unit_List_Link * api_methods_unit_list_next_link ( lua_State *  L,
Unit_List_Link ul_link 
)

Return next list link or NULL when link is the last link

Definition at line 1325 of file api_game_methods.c.

Referenced by tolua_game_Unit_List_Link_next00().

◆ api_methods_unit_orientation_get()

const Direction * api_methods_unit_orientation_get ( lua_State *  L,
Unit punit 
)

Get unit orientation

Definition at line 1199 of file api_game_methods.c.

Referenced by tolua_game_Unit_facing00().

◆ api_methods_unit_tile_get()

Tile * api_methods_unit_tile_get ( lua_State *  L,
Unit punit 
)

Return the tile of the unit.

Definition at line 1188 of file api_game_methods.c.

Referenced by tolua_game_Unit_properties_tile00().

◆ api_methods_unit_tile_link()

const char * api_methods_unit_tile_link ( lua_State *  L,
Unit punit 
)

Return featured text link of the unit tile.

Definition at line 1369 of file api_game_methods.c.

Referenced by tolua_game_Unit_tile_link_text00().

◆ api_methods_unit_transform_problem()

const char * api_methods_unit_transform_problem ( lua_State *  L,
Unit punit,
Unit_Type ptype 
)

Return a name of the problem unit may have being transformed to ptype where it is now, or nil if no problem seems to exist.

Definition at line 604 of file api_game_methods.c.

Referenced by tolua_game_Unit_transform_problem00().

◆ api_methods_unit_transporter()

Unit * api_methods_unit_transporter ( lua_State *  L,
Unit punit 
)

Return Unit that transports punit, if any.

Definition at line 1211 of file api_game_methods.c.

Referenced by tolua_game_Unit_transporter00().

◆ api_methods_unit_type_can_exist_at_tile()

bool api_methods_unit_type_can_exist_at_tile ( lua_State *  L,
Unit_Type punit_type,
Tile ptile 
)

Return TRUE iff the unit type can exist on the tile.

Definition at line 1275 of file api_game_methods.c.

Referenced by tolua_game_Unit_Type_can_exist_at_tile00().

◆ api_methods_unit_type_has_flag()

bool api_methods_unit_type_has_flag ( lua_State *  L,
Unit_Type punit_type,
const char *  flag 
)

Return TRUE if punit_type has flag.

Definition at line 1233 of file api_game_methods.c.

Referenced by tolua_game_Unit_Type_has_flag00().

◆ api_methods_unit_type_has_role()

bool api_methods_unit_type_has_role ( lua_State *  L,
Unit_Type punit_type,
const char *  role 
)

Return TRUE if punit_type has role.

Definition at line 1254 of file api_game_methods.c.

Referenced by tolua_game_Unit_Type_has_role00().

◆ api_methods_unit_type_name_translation()

const char * api_methods_unit_type_name_translation ( lua_State *  L,
Unit_Type punit_type 
)

Return translated name for Unit_Type

Definition at line 1301 of file api_game_methods.c.

Referenced by tolua_game_Unit_Type_name_translation00().

◆ api_methods_unit_type_rule_name()

const char * api_methods_unit_type_rule_name ( lua_State *  L,
Unit_Type punit_type 
)

Return rule name for Unit_Type

Definition at line 1289 of file api_game_methods.c.

Referenced by tolua_game_Unit_Type_rule_name00().