![]() |
Freeciv21
Develop your civilization from humble roots to a global empire
|
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Classes | |
| struct | pf_position |
| class | PFPath |
| struct | pf_parameter |
Macros | |
| #define | PF_IMPOSSIBLE_MC -1 |
| #define | PF_TURN_FACTOR 65536 |
| #define | pf_map_tiles_iterate(ARG_pfm, NAME_tile, COND_from_start) |
| #define | pf_map_tiles_iterate_end |
| #define | pf_map_move_costs_iterate(ARG_pfm, NAME_tile, NAME_cost, COND_from_start) |
| #define | pf_map_move_costs_iterate_end |
| #define | pf_map_positions_iterate(ARG_pfm, NAME_pos, COND_from_start) |
| #define | pf_map_positions_iterate_end |
Enumerations | |
| enum | pf_action { PF_ACTION_NONE = 0 , PF_ACTION_ATTACK , PF_ACTION_DIPLOMAT , PF_ACTION_TRADE_ROUTE , PF_ACTION_IMPOSSIBLE = -1 } |
| enum | pf_action_account { PF_AA_NONE = 0 , PF_AA_UNIT_ATTACK = 1 << 0 , PF_AA_CITY_ATTACK = 1 << 1 , PF_AA_DIPLOMAT = 1 << 2 , PF_AA_TRADE_ROUTE = 1 << 3 } |
| enum | tile_behavior { TB_NORMAL = 0 , TB_IGNORE , TB_DONT_LEAVE } |
| enum | pf_move_scope { PF_MS_NONE = 0 , PF_MS_NATIVE = 1 << 0 , PF_MS_CITY = 1 << 1 , PF_MS_TRANSPORT = 1 << 2 } |
Functions | |
| QDebug & | operator<< (QDebug &logger, const PFPath &path) |
| Debug a path. More... | |
| struct pf_map * | pf_map_new (const struct pf_parameter *parameter) fc__warn_unused_result |
| Factory function to create a new map according to the parameter. More... | |
| void | pf_map_destroy (struct pf_map *pfm) |
| After usage the map must be destroyed. More... | |
| int | pf_map_move_cost (struct pf_map *pfm, struct tile *ptile) |
| Tries to find the minimal move cost to reach ptile. More... | |
| PFPath | pf_map_path (struct pf_map *pfm, struct tile *ptile) fc__warn_unused_result |
| CHECK DOCS AFTER FULL CONVERSTION OF pf_path to class PFPath Tries to find the best path in the given map to the position ptile. More... | |
| bool | pf_map_position (struct pf_map *pfm, struct tile *ptile, struct pf_position *pos) fc__warn_unused_result |
| Get info about position at ptile and put it in pos. More... | |
| bool | pf_map_iterate (struct pf_map *pfm) |
| Iterates the path-finding algorithm one step further, to the next nearest position. More... | |
| struct tile * | pf_map_iter (struct pf_map *pfm) |
| Return the current tile. More... | |
| int | pf_map_iter_move_cost (struct pf_map *pfm) |
| Return the move cost at the current position. More... | |
| PFPath | pf_map_iter_path (struct pf_map *pfm) fc__warn_unused_result |
| Return the path to our current position.This is equivalent to pf_map_path(pfm, pf_map_iter(pfm)). More... | |
| void | pf_map_iter_position (struct pf_map *pfm, struct pf_position *pos) |
| Read all info about the current position into pos. More... | |
| const struct pf_parameter * | pf_map_parameter (const struct pf_map *pfm) |
| Return the pf_parameter for given pf_map. More... | |
| struct pf_reverse_map * | pf_reverse_map_new (const struct player *pplayer, struct tile *start_tile, int max_turns, bool omniscient, const struct civ_map *map) fc__warn_unused_result |
| 'pf_reverse_map' constructor. More... | |
| struct pf_reverse_map * | pf_reverse_map_new_for_city (const struct city *pcity, const struct player *attacker, int max_turns, bool omniscient, const struct civ_map *map) fc__warn_unused_result |
| 'pf_reverse_map' constructor for city. More... | |
| void | pf_reverse_map_destroy (struct pf_reverse_map *prfm) |
| 'pf_reverse_map' destructor. More... | |
| int | pf_reverse_map_unit_move_cost (struct pf_reverse_map *pfrm, const struct unit *punit) |
| Get the move costs that a unit needs to reach the start tile. More... | |
| bool | pf_reverse_map_unit_position (struct pf_reverse_map *pfrm, const struct unit *punit, struct pf_position *pos) |
| Fill the position. More... | |
| #define PF_IMPOSSIBLE_MC -1 |
Definition at line 244 of file path_finding.h.
| #define pf_map_move_costs_iterate | ( | ARG_pfm, | |
| NAME_tile, | |||
| NAME_cost, | |||
| COND_from_start | |||
| ) |
Definition at line 532 of file path_finding.h.
| #define pf_map_move_costs_iterate_end |
Definition at line 542 of file path_finding.h.
| #define pf_map_positions_iterate | ( | ARG_pfm, | |
| NAME_pos, | |||
| COND_from_start | |||
| ) |
Definition at line 557 of file path_finding.h.
| #define pf_map_positions_iterate_end |
Definition at line 564 of file path_finding.h.
| #define pf_map_tiles_iterate | ( | ARG_pfm, | |
| NAME_tile, | |||
| COND_from_start | |||
| ) |
Definition at line 509 of file path_finding.h.
| #define pf_map_tiles_iterate_end |
Definition at line 516 of file path_finding.h.
| #define PF_TURN_FACTOR 65536 |
Definition at line 250 of file path_finding.h.
| enum pf_action |
| Enumerator | |
|---|---|
| PF_ACTION_NONE | |
| PF_ACTION_ATTACK | |
| PF_ACTION_DIPLOMAT | |
| PF_ACTION_TRADE_ROUTE | |
| PF_ACTION_IMPOSSIBLE | |
Definition at line 255 of file path_finding.h.
| enum pf_action_account |
| Enumerator | |
|---|---|
| PF_AA_NONE | |
| PF_AA_UNIT_ATTACK | |
| PF_AA_CITY_ATTACK | |
| PF_AA_DIPLOMAT | |
| PF_AA_TRADE_ROUTE | |
Definition at line 264 of file path_finding.h.
| enum pf_move_scope |
| Enumerator | |
|---|---|
| PF_MS_NONE | |
| PF_MS_NATIVE | |
| PF_MS_CITY | |
| PF_MS_TRANSPORT | |
Definition at line 287 of file path_finding.h.
| enum tile_behavior |
| Enumerator | |
|---|---|
| TB_NORMAL | |
| TB_IGNORE | |
| TB_DONT_LEAVE | |
Definition at line 276 of file path_finding.h.
| QDebug& operator<< | ( | QDebug & | logger, |
| const PFPath & | path | ||
| ) |
Debug a path.
Definition at line 3310 of file path_finding.cpp.
| void pf_map_destroy | ( | struct pf_map * | pfm | ) |
After usage the map must be destroyed.
Definition at line 3055 of file path_finding.cpp.
Referenced by auto_settler_setup_work(), calculate_city_clusters(), caravan_search_from(), dai_choose_diplomat_offensive(), dai_find_strategic_airbase(), dai_hunter_manage(), dai_hunter_try_launch(), dai_manage_airunit(), dai_manage_barbarian_leader(), dai_manage_diplomat(), dai_unit_can_strike_my_unit(), dai_unit_goto_constrained(), dai_wonder_city_distance(), explorer_goto(), find_nearest_airbase(), find_nearest_safe_city(), find_rampage_target(), find_something_to_bomb(), find_something_to_kill(), goto_is_sane(), immediate_destination(), kill_something_with(), look_for_charge(), pf_reverse_map_pos(), player_restore_units(), process_attacker_want(), send_attack_tile(), send_goto_tile(), send_rally_tile(), settler_evaluate_city_requests(), settler_evaluate_improvements(), settler_map_iterate(), and tile_before_end_path().
Return the current tile.
Definition at line 3160 of file path_finding.cpp.
| int pf_map_iter_move_cost | ( | struct pf_map * | pfm | ) |
Return the move cost at the current position.
This is equivalent to pf_map_move_cost(pfm, pf_map_iter(pfm)).
Definition at line 3172 of file path_finding.cpp.
Return the path to our current position.This is equivalent to pf_map_path(pfm, pf_map_iter(pfm)).
Definition at line 3185 of file path_finding.cpp.
| void pf_map_iter_position | ( | struct pf_map * | pfm, |
| struct pf_position * | pos | ||
| ) |
Read all info about the current position into pos.
This is equivalent to pf_map_position(pfm, pf_map_iter(pfm), &pos).
Definition at line 3198 of file path_finding.cpp.
Referenced by process_attacker_want().
| bool pf_map_iterate | ( | struct pf_map * | pfm | ) |
Iterates the path-finding algorithm one step further, to the next nearest position.
This full info on this position and the best path to it can be obtained using pf_map_iter_move_cost(), pf_map_iter_path(), and pf_map_iter_position() correspondingly. Returns FALSE if no further positions are available in this map.
NB: If pf_map_move_cost(pfm, ptile), pf_map_path(pfm, ptile), or pf_map_position(pfm, ptile) has been called before the call to pf_map_iterate(), the iteration will resume from 'ptile'.
Definition at line 3136 of file path_finding.cpp.
Referenced by pf_danger_map_iterate_until(), pf_fuel_map_iterate_until(), and pf_normal_map_iterate_until().
Tries to find the minimal move cost to reach ptile.
Returns PF_IMPOSSIBLE_MC if not reachable. If ptile has not been reached yet, iterate the map until we reach it or run out of map.
Definition at line 3068 of file path_finding.cpp.
Referenced by dai_manage_barbarian_leader(), find_beachhead(), and goto_is_sane().
| struct pf_map* pf_map_new | ( | const struct pf_parameter * | parameter | ) |
Factory function to create a new map according to the parameter.
Does not do any iterations.
Definition at line 3031 of file path_finding.cpp.
Referenced by auto_settler_setup_work(), calculate_city_clusters(), caravan_search_from(), dai_choose_diplomat_offensive(), dai_find_strategic_airbase(), dai_hunter_manage(), dai_hunter_try_launch(), dai_manage_airunit(), dai_manage_barbarian_leader(), dai_manage_diplomat(), dai_unit_can_strike_my_unit(), dai_unit_goto_constrained(), dai_wonder_city_distance(), explorer_goto(), find_nearest_airbase(), find_nearest_safe_city(), find_rampage_target(), find_something_to_bomb(), find_something_to_kill(), goto_is_sane(), immediate_destination(), look_for_charge(), player_restore_units(), process_attacker_want(), send_attack_tile(), send_goto_tile(), send_rally_tile(), settler_evaluate_city_requests(), settler_evaluate_improvements(), settler_map_iterate(), and tile_before_end_path().
| const struct pf_parameter* pf_map_parameter | ( | const struct pf_map * | pfm | ) |
Return the pf_parameter for given pf_map.
Definition at line 3213 of file path_finding.cpp.
Referenced by pf_danger_map_construct_path(), pf_danger_map_create_segment(), pf_danger_map_fill_position(), pf_danger_map_iterate(), pf_danger_map_move_cost(), pf_danger_map_path(), pf_danger_map_position(), pf_danger_node_init(), pf_fuel_map_construct_path(), pf_fuel_map_create_segment(), pf_fuel_map_fill_position(), pf_fuel_map_iterate(), pf_fuel_map_move_cost(), pf_fuel_map_path(), pf_fuel_map_position(), pf_fuel_node_init(), pf_jumbo_map_iterate(), pf_map_path(), pf_normal_map_construct_path(), pf_normal_map_fill_position(), pf_normal_map_iterate(), pf_normal_map_iterate_until(), pf_normal_map_move_cost(), pf_normal_map_path(), pf_normal_map_position(), pf_normal_node_init(), and process_attacker_want().
CHECK DOCS AFTER FULL CONVERSTION OF pf_path to class PFPath Tries to find the best path in the given map to the position ptile.
If empty path is returned no path could be found. The pf_path[-1] of such path would be the same (almost) as the result of the call to pf_map_position(). If ptile has not been reached yet, iterate the map until we reach it or run out of map.
Definition at line 3085 of file path_finding.cpp.
Referenced by auto_settler_setup_work(), dai_diplomat_bribe_nearby(), dai_find_strategic_airbase(), dai_hunter_manage(), dai_manage_airunit(), dai_manage_barbarian_leader(), dai_manage_diplomat(), dai_unit_goto_constrained(), explorer_goto(), find_nearest_airbase(), find_rampage_target(), find_something_to_bomb(), find_something_to_kill(), immediate_destination(), player_restore_units(), send_attack_tile(), send_goto_tile(), send_rally_tile(), settler_evaluate_city_requests(), settler_evaluate_improvements(), and tile_before_end_path().
| bool pf_map_position | ( | struct pf_map * | pfm, |
| struct tile * | ptile, | ||
| struct pf_position * | pos | ||
| ) |
Get info about position at ptile and put it in pos.
If ptile has not been reached yet, iterate the map until we reach it. Should always check the return value, forthe position might be unreachable.
Definition at line 3115 of file path_finding.cpp.
Referenced by dai_manage_diplomat(), find_something_to_kill(), process_attacker_want(), settler_evaluate_city_requests(), and settler_evaluate_improvements().
| void pf_reverse_map_destroy | ( | struct pf_reverse_map * | prfm | ) |
'pf_reverse_map' destructor.
Definition at line 3433 of file path_finding.cpp.
Referenced by assess_danger(), and dai_manage_barbarian_leader().
| struct pf_reverse_map* pf_reverse_map_new | ( | const struct player * | pplayer, |
| struct tile * | target_tile, | ||
| int | max_turns, | ||
| bool | omniscient, | ||
| const struct civ_map * | map | ||
| ) |
'pf_reverse_map' constructor.
If 'max_turns' is positive, then it won't try to iterate the maps beyond this number of turns.
Definition at line 3394 of file path_finding.cpp.
Referenced by dai_manage_barbarian_leader(), and pf_reverse_map_new_for_city().
| struct pf_reverse_map* pf_reverse_map_new_for_city | ( | const struct city * | pcity, |
| const struct player * | attacker, | ||
| int | max_turns, | ||
| bool | omniscient, | ||
| const struct civ_map * | map | ||
| ) |
'pf_reverse_map' constructor for city.
If 'max_turns' is positive, then it won't try to iterate the maps beyond this number of turns.
Definition at line 3422 of file path_finding.cpp.
Referenced by assess_danger().
| int pf_reverse_map_unit_move_cost | ( | struct pf_reverse_map * | pfrm, |
| const struct unit * | punit | ||
| ) |
Get the move costs that a unit needs to reach the start tile.
Returns PF_IMPOSSIBLE_MC if the tile is unreachable.
Definition at line 3538 of file path_finding.cpp.
Referenced by dai_manage_barbarian_leader().
| bool pf_reverse_map_unit_position | ( | struct pf_reverse_map * | pfrm, |
| const struct unit * | punit, | ||
| struct pf_position * | pos | ||
| ) |
Fill the position.
Return TRUE if the tile is reachable.
Definition at line 3549 of file path_finding.cpp.
Referenced by assess_danger_unit().