![]() |
Freeciv21
Develop your civilization from humble roots to a global empire
|
Include dependency graph for road.cpp:Go to the source code of this file.
Functions | |
| Road_type_id | road_number (const struct road_type *proad) |
| Return the road id. More... | |
| struct extra_type * | road_extra_get (const struct road_type *proad) |
| Return extra that road is. More... | |
| Road_type_id | road_count () |
| Return the number of road_types. More... | |
| struct road_type * | road_by_number (Road_type_id id) |
| Return road type of given id. More... | |
| int | compare_road_move_cost (const struct extra_type *const *p, const struct extra_type *const *q) |
| This function is passed to road_type_list_sort() to sort a list of roads in ascending move_cost (faster roads first). More... | |
| void | road_type_init (struct extra_type *pextra, int idx) |
| Initialize road_type structures. More... | |
| void | road_integrators_cache_init () |
| Initialize the road integrators cache. More... | |
| void | road_types_free () |
| Free the memory associated with road types. More... | |
| enum road_compat | road_compat_special (const struct road_type *proad) |
| Return tile special that used to represent this road type. More... | |
| struct road_type * | road_by_compat_special (enum road_compat compat) |
| Return road type represented by given compatibility special, or nullptr if special does not represent road type at all. More... | |
| bool | road_can_be_built (const struct road_type *proad, const struct tile *ptile) |
| Tells if road can build to tile if all other requirements are met. More... | |
| static bool | are_road_reqs_fulfilled (const struct road_type *proad, const struct player *pplayer, const struct unit *punit, const struct tile *ptile) |
| Tells if player and optionally unit have road building requirements fulfilled. More... | |
| bool | player_can_build_road (const struct road_type *proad, const struct player *pplayer, const struct tile *ptile) |
| Tells if player can build road to tile with suitable unit. More... | |
| bool | can_build_road (struct road_type *proad, const struct unit *punit, const struct tile *ptile) |
| Tells if unit can build road on tile. More... | |
| int | count_river_near_tile (const struct tile *ptile, const struct extra_type *priver) |
| Count tiles with any river near the tile. More... | |
| int | count_river_type_tile_card (const struct tile *ptile, const struct extra_type *priver, bool percentage) |
| Count tiles with river of specific type cardinally adjacent to the tile. More... | |
| int | count_river_type_near_tile (const struct tile *ptile, const struct extra_type *priver, bool percentage) |
| Count tiles with river of specific type near the tile. More... | |
| bool | road_has_flag (const struct road_type *proad, enum road_flag_id flag) |
| Check if road provides effect. More... | |
| bool | is_road_flag_card_near (const struct tile *ptile, enum road_flag_id flag) |
| Returns TRUE iff any cardinally adjacent tile contains a road with the given flag (does not check ptile itself). More... | |
| bool | is_road_flag_near_tile (const struct tile *ptile, enum road_flag_id flag) |
| Returns TRUE iff any adjacent tile contains a road with the given flag (does not check ptile itself). More... | |
| bool | is_cardinal_only_road (const struct extra_type *pextra) |
| Is extra cardinal only road. More... | |
| bool | road_provides_move_bonus (const struct road_type *proad) |
| Does road type provide move bonus. More... | |
|
static |
Tells if player and optionally unit have road building requirements fulfilled.
Definition at line 197 of file road.cpp.
Referenced by can_build_road(), and player_can_build_road().
| bool can_build_road | ( | struct road_type * | proad, |
| const struct unit * | punit, | ||
| const struct tile * | ptile | ||
| ) |
Tells if unit can build road on tile.
Definition at line 275 of file road.cpp.
Referenced by can_units_do_any_road(), check_recursive_road_connect(), and unit_actions::update_actions().
| int compare_road_move_cost | ( | const struct extra_type *const * | p, |
| const struct extra_type *const * | q | ||
| ) |
This function is passed to road_type_list_sort() to sort a list of roads in ascending move_cost (faster roads first).
Definition at line 63 of file road.cpp.
Referenced by road_integrators_cache_init().
| int count_river_near_tile | ( | const struct tile * | ptile, |
| const struct extra_type * | priver | ||
| ) |
Count tiles with any river near the tile.
Definition at line 290 of file road.cpp.
Referenced by is_terrain_ecologically_wet(), make_river(), and make_rivers().
| int count_river_type_near_tile | ( | const struct tile * | ptile, |
| const struct extra_type * | priver, | ||
| bool | percentage | ||
| ) |
Count tiles with river of specific type near the tile.
Definition at line 340 of file road.cpp.
Referenced by island_river_suitability().
| int count_river_type_tile_card | ( | const struct tile * | ptile, |
| const struct extra_type * | priver, | ||
| bool | percentage | ||
| ) |
Count tiles with river of specific type cardinally adjacent to the tile.
Definition at line 313 of file road.cpp.
Referenced by island_river_mouth_suitability(), island_river_suitability(), river_test_adjacent_river(), and river_test_rivergrid().
| bool is_cardinal_only_road | ( | const struct extra_type * | pextra | ) |
Is extra cardinal only road.
Definition at line 421 of file road.cpp.
Referenced by are_road_reqs_fulfilled(), fair_map_island_new(), and freeciv::layer_roads::fill_corners().
| bool is_road_flag_card_near | ( | const struct tile * | ptile, |
| enum road_flag_id | flag | ||
| ) |
| bool is_road_flag_near_tile | ( | const struct tile * | ptile, |
| enum road_flag_id | flag | ||
| ) |
| bool player_can_build_road | ( | const struct road_type * | proad, |
| const struct player * | pplayer, | ||
| const struct tile * | ptile | ||
| ) |
Tells if player can build road to tile with suitable unit.
Definition at line 261 of file road.cpp.
Referenced by check_recursive_road_connect().
| struct road_type* road_by_compat_special | ( | enum road_compat | compat | ) |
Return road type represented by given compatibility special, or nullptr if special does not represent road type at all.
Definition at line 152 of file road.cpp.
Referenced by mr_menu::menus_sensitive(), sg_load_player_unit(), sg_special_set(), mr_menu::slot_conn_rail(), and mr_menu::slot_conn_road().
| struct road_type* road_by_number | ( | Road_type_id | id | ) |
Return road type of given id.
Definition at line 46 of file road.cpp.
Referenced by handle_ruleset_road(), set_unit_activity_road(), and sg_load_player_unit().
Tells if road can build to tile if all other requirements are met.
Definition at line 173 of file road.cpp.
Referenced by get_tile_value().
| enum road_compat road_compat_special | ( | const struct road_type * | proad | ) |
Return tile special that used to represent this road type.
Definition at line 124 of file road.cpp.
Referenced by road_by_compat_special().
| Road_type_id road_count | ( | ) |
Return the number of road_types.
Definition at line 41 of file road.cpp.
Referenced by editor_tool_is_usable(), and tab_misc::refresh_stats().
| struct extra_type* road_extra_get | ( | const struct road_type * | proad | ) |
Return extra that road is.
Definition at line 33 of file road.cpp.
Referenced by adv_settlers_road_bonus(), are_road_reqs_fulfilled(), can_build_road(), mr_menu::menus_sensitive(), player_can_build_road(), road_can_be_built(), set_unit_activity_road(), settler_evaluate_improvements(), sg_load_player_unit(), sg_roads_set(), sg_special_set(), mr_menu::slot_conn_rail(), mr_menu::slot_conn_road(), and tile_has_road().
| bool road_has_flag | ( | const struct road_type * | proad, |
| enum road_flag_id | flag | ||
| ) |
Check if road provides effect.
Definition at line 367 of file road.cpp.
Referenced by evaluate_city_name_priority(), helptext_extra(), is_native_move(), is_native_tile_to_extra(), is_road_flag_card_near(), is_road_flag_near_tile(), ocean_to_land_fix_rivers(), remove_tiny_islands(), river_types_init(), save_terrain_ruleset(), tile_has_river(), tile_has_road_flag(), and tile_move_cost_ptrs().
| void road_integrators_cache_init | ( | ) |
Initialize the road integrators cache.
Definition at line 97 of file road.cpp.
Referenced by handle_rulesets_ready(), and load_rulesetdir().
| Road_type_id road_number | ( | const struct road_type * | proad | ) |
Return the road id.
Definition at line 23 of file road.cpp.
Referenced by adv_settlers_road_bonus(), load_ruleset_terrain(), road_integrators_cache_init(), sanity_check_ruleset_data(), send_ruleset_roads(), and sg_load_player_unit().
| bool road_provides_move_bonus | ( | const struct road_type * | proad | ) |
Does road type provide move bonus.
Definition at line 437 of file road.cpp.
Referenced by helptext_extra(), set_unit_class_caches(), settler_evaluate_improvements(), tai_tile_worker_task_select(), and texai_tile_worker_task_select().
| void road_type_init | ( | struct extra_type * | pextra, |
| int | idx | ||
| ) |
Initialize road_type structures.
Definition at line 81 of file road.cpp.
Referenced by handle_ruleset_extra(), and load_terrain_names().
| void road_types_free | ( | ) |
Free the memory associated with road types.
Definition at line 124 of file road.cpp.
Referenced by extras_free().