36#define SPECPQ_TAG map_index
37#define SPECPQ_DATA_TYPE int
38#define SPECPQ_PRIORITY_TYPE int
40#define INITIAL_QUEUE_SIZE 100
97#define PF_MAP(pfm) ((struct pf_map *) (pfm))
173 unsigned cost,
unsigned extra)
240pf_normal_map_check(
struct pf_map *pfm,
const char *file,
241 const char *function,
int line)
244 NULL != pfm && PF_NORMAL == pfm->mode,
245 return NULL,
"Wrong pf_map to pf_normal_map conversion.");
248#define PF_NORMAL_MAP(pfm) \
249 pf_normal_map_check(pfm, __FILE__, __FUNCTION__, __FC_LINE__)
251#define PF_NORMAL_MAP(pfm) ((struct pf_normal_map *) (pfm))
286 if (NULL != params->
get_TB) {
291#ifdef ZERO_VARIABLES_FOR_SEARCHING
331#ifdef ZERO_VARIABLES_FOR_SEARCHING
341 previous_scope, params);
368#ifdef ZERO_VARIABLES_FOR_SEARCHING
377#ifdef ZERO_VARIABLES_FOR_SEARCHING
385 if (NULL != params->
get_EC) {
387#ifdef ZERO_VARIABLES_FOR_SEARCHING
411 "Unreached destination (%d, %d).",
TILE_XY(ptile));
426 pos->dir_to_next_pos = direction8_invalid();
428 if (node->
cost > 0) {
439 struct tile *dest_tile)
443 enum direction8 dir_next = direction8_invalid();
450 "Unreached destination (%d, %d).",
477 for (; i >= 0; i--) {
540 unsigned extra_cost1;
564 &extra_cost1, params);
581 if (!map_index_pq_remove(pfnm->
queue, &tindex)) {
678 ACTION_SUICIDE_ATTACK))) {
701 if (NULL != params->
get_EC) {
717 map_index_pq_insert(pfnm->
queue, tindex1, -cost_of_path);
727 map_index_pq_replace(pfnm->
queue, tindex1, -cost_of_path);
733 if (!map_index_pq_remove(pfnm->
queue, &tindex)) {
850 map_index_pq_destroy(pfnm->
queue);
866 params = &base_map->
params;
869 base_map->mode = PF_NORMAL;
885 *params = *parameter;
991pf_danger_map_check(
struct pf_map *pfm,
const char *file,
992 const char *function,
int line)
995 NULL != pfm && PF_DANGER == pfm->mode,
996 return NULL,
"Wrong pf_map to pf_danger_map conversion.");
999#define PF_DANGER_MAP(pfm) \
1000 pf_danger_map_check(pfm, __FILE__, __FUNCTION__, __FC_LINE__)
1002#define PF_DANGER_MAP(pfm) ((struct pf_danger_map *) (pfm))
1037 if (NULL != params->
get_TB) {
1042#ifdef ZERO_VARIABLES_FOR_SEARCHING
1082#ifdef ZERO_VARIABLES_FOR_SEARCHING
1092 previous_scope, params);
1119#ifdef ZERO_VARIABLES_FOR_SEARCHING
1128#ifdef ZERO_VARIABLES_FOR_SEARCHING
1136 if (NULL != params->
get_EC) {
1138#ifdef ZERO_VARIABLES_FOR_SEARCHING
1145#ifdef ZERO_VARIABLES_FOR_SEARCHING
1172 "Unreached destination (%d, %d).",
TILE_XY(ptile));
1187 pos->dir_to_next_pos = direction8_invalid();
1189 if (node->
cost > 0) {
1206 return cost + moves_left;
1221 enum direction8 dir_next = direction8_invalid();
1222 struct pf_danger_pos *danger_seg = NULL;
1223 bool waited =
FALSE;
1225 unsigned length = 1;
1226 struct tile *iter_tile = ptile;
1234 "Unreached destination (%d, %d).",
1274 for (i = length - 1; i >= 0; i--) {
1275 bool old_waited =
FALSE;
1284 pos->tile = iter_tile;
1289 pos->fuel_left = params->
fuel;
1292 pos->dir_to_next_pos = dir_next;
1305 pos->tile = iter_tile;
1312 pos->total_MC = danger_seg->cost;
1313 pos->total_EC = danger_seg->extra_cost;
1324 pos->dir_to_next_pos = (old_waited ? direction8_invalid() : dir_next);
1325 if (node->
cost > 0) {
1382 struct pf_danger_pos *
pos;
1383 unsigned length = 0;
1389 log_error(
"Possible memory leak in pf_danger_map_create_segment().");
1404 ptile =
PF_MAP(pfdm)->tile;
1413 if (i == length - 1) {
1434 int cost,
bool to_danger,
int moves_left)
1445 if (to_danger &&
cost >= moves_left) {
1527 loc_cost = node->
cost;
1572 node1->
action, params)) {
1580 ACTION_SUICIDE_ATTACK))) {
1608 if (NULL != params->
get_EC) {
1642 map_index_pq_insert(pfdm->
queue, tindex1, -cost_of_path);
1647 map_index_pq_replace(pfdm->
queue, tindex1, -cost_of_path);
1700 map_index_pq_insert(pfdm->
queue, tindex, -cc);
1705 if (map_index_pq_remove(pfdm->
danger_queue, &tindex)) {
1709 node = pfdm->
lattice + tindex;
1712 if (!map_index_pq_remove(pfdm->
queue, &tindex)) {
1724 node = pfdm->
lattice + tindex;
1750 log_error(
"%s(): internal error.", __FUNCTION__);
1863 map_index_pq_destroy(pfdm->
queue);
1880 params = &base_map->
params;
1883 base_map->mode = PF_DANGER;
1901 *params = *parameter;
2012pf_fuel_map_check(
struct pf_map *pfm,
const char *file,
2013 const char *function,
int line)
2016 NULL != pfm && PF_FUEL == pfm->mode,
2017 return NULL,
"Wrong pf_map to pf_fuel_map conversion.");
2020#define PF_FUEL_MAP(pfm) \
2021 pf_fuel_map_check(pfm, __FILE__, __FUNCTION__, __FC_LINE__)
2023#define PF_FUEL_MAP(pfm) ((struct pf_fuel_map *) (pfm))
2032 int cost,
int extra,
int safety)
2075 if (NULL != params->
get_TB) {
2080#ifdef ZERO_VARIABLES_FOR_SEARCHING
2121#ifdef ZERO_VARIABLES_FOR_SEARCHING
2125#ifdef ZERO_VARIABLES_FOR_SEARCHING
2145 previous_scope, params);
2172#ifdef ZERO_VARIABLES_FOR_SEARCHING
2193#ifdef ZERO_VARIABLES_FOR_SEARCHING
2201 if (NULL != params->
get_EC) {
2203#ifdef ZERO_VARIABLES_FOR_SEARCHING
2210#ifdef ZERO_VARIABLES_FOR_SEARCHING
2224 return (NULL == node->
pos
2250 while (NULL !=
pos && 0 == --
pos->ref_count) {
2270 }
else if (1 <
pos->ref_count) {
2345 "Unreached destination (%d, %d).",
TILE_XY(ptile));
2353 pos->dir_to_next_pos = direction8_invalid();
2364 int cost,
int moves_left)
2380 enum direction8 dir_next = direction8_invalid();
2383 unsigned length = 1;
2384 struct tile *iter_tile = ptile;
2391 "Unreached destination (%d, %d).",
2398 while (direction8_is_valid(segment->
dir_to_here)) {
2401 if (segment != node->
segment) {
2415 segment = segment->
prev;
2434 for (i = length - 1; i >= 0; i--) {
2441 pos->tile = iter_tile;
2447 pos->fuel_left = params->
fuel;
2448 pos->dir_to_next_pos = dir_next;
2449 dir_next = direction8_invalid();
2452 if (NULL == segment) {
2465 pos->tile = iter_tile;
2469 pos->dir_to_next_pos = dir_next;
2485 segment = segment->
prev;
2552 int remaining_moves = moves_left %
move_rate;
2554 if (remaining_moves == 0) {
2558 return MIN(
cost, remaining_moves);
2572 int moves_left,
int moves_left_req)
2640 bool waited =
FALSE;
2666 int loc_cost = node->
cost;
2671 && 0 == loc_moves_left % params->
move_rate
2684 int cost, extra = 0;
2686 int cost_of_path, old_cost_of_path;
2722 node1->
action, params)) {
2732 ACTION_SUICIDE_ATTACK))) {
2771 if (moves_left < node1->moves_left_req
2790 if (NULL != params->
get_EC) {
2801 old_cost_of_path = 0;
2821 || (node1->
status ==
NS_NEW && cost_of_path < old_cost_of_path)) {
2836 map_index_pq_insert(pffm->
queue, tindex1, -cost_of_path);
2842 if (cost_of_path < old_cost_of_path) {
2843 map_index_pq_replace(pffm->
queue, tindex1, -cost_of_path);
2904 map_index_pq_insert(pffm->
queue, tindex,
2915 || (map_index_pq_priority(pffm->
waited_queue, &waited_priority)
2917 if (!map_index_pq_remove(pffm->
waited_queue, &tindex)) {
2925 node = pffm->
lattice + tindex;
2933#ifndef FREECIV_NDEBUG
2936 map_index_pq_remove(pffm->
queue, &tindex);
2940 map_index_pq_remove(pffm->
queue, &tindex);
2946 node = pffm->
lattice + tindex;
2984 log_error(
"%s(): internal error.", __FUNCTION__);
3010 while (NULL == node->
segment) {
3097 map_index_pq_destroy(pffm->
queue);
3114 params = &base_map->
params;
3117 base_map->mode = PF_FUEL;
3135 *params = *parameter;
3186 log_error(
"path finding code cannot deal with dangers "
3187 "and fuel together.");
3190 log_error(
"jumbo callbacks for danger maps are not yet implemented.");
3195 log_error(
"jumbo callbacks for fuel maps are not yet implemented.");
3245#ifndef FREECIV_NDEBUG
3294 if (NULL == pfm->
tile) {
3388 pos->dir_to_next_pos = direction8_invalid();
3389 pos->dir_to_here = direction8_invalid();
3427 const struct pf_path *src_path)
3433 if (dest_path == NULL) {
3435 dest_path =
fc_malloc(
sizeof(*dest_path));
3444 dest_end = dest_path->
length - 1;
3452 if (src_path->
length == 1) {
3488 memcpy(new_positions, path->
positions + i,
3541 const char *file,
const char *function,
int line)
3548 "PF: path (at %p) consists of %d positions:",
3549 (
void *) path, path->
length);
3557 "PF: %2d/%2d: (%2d,%2d) dir=%-2s cost=%2d (%2d, %d) EC=%d",
3560 pos->turn,
pos->moves_left,
pos->total_EC);
3577#define SPECHASH_TAG pf_pos
3578#define SPECHASH_IKEY_TYPE struct pf_parameter *
3579#define SPECHASH_IDATA_TYPE struct pf_position *
3580#define SPECHASH_IKEY_VAL pf_pos_hash_val
3581#define SPECHASH_IKEY_COMP pf_pos_hash_cmp
3582#define SPECHASH_IKEY_FREE pf_reverse_map_destroy_param
3583#define SPECHASH_IDATA_FREE pf_reverse_map_destroy_pos
3597 UTYF_IGTER, UTYF_CIVILIAN, UTYF_COAST_STRICT
3612 result |= (1u << b);
3639 if (parameter1->
utype == parameter2->
utype) {
3689 const struct player *pplayer,
3701 param->
owner = pplayer;
3706 pfrm->
hash = pf_pos_hash_new();
3716 const struct city *pcity,
3717 const struct player *attacker,
3730 pf_pos_hash_destroy(pfrm->
hash);
3750 if (pf_pos_hash_lookup(pfrm->
hash, param, &
pos)) {
3769 pf_pos_hash_insert(pfrm->
hash, copy,
pos);
3783 pf_pos_hash_insert(pfrm->
hash, copy,
pos);
3795 pf_pos_hash_insert(pfrm->
hash, copy, NULL);
3832 NULL, EFT_VETERAN_BUILD);
3843 param->
utype = punittype;
3884 if (mypos != NULL) {
3901 if (mypos != NULL) {
static struct action * action_by_number(action_id act_id)
#define city_tile(_pcity_)
struct unit struct city struct unit struct tile * target_tile
struct unit struct city struct unit struct tile struct extra_type const struct act_prob *act_probs int actor_unit_id struct unit struct unit * punit
struct unit struct city struct unit struct tile struct extra_type const struct act_prob *act_probs int actor_unit_id struct unit struct unit int cost
int get_unittype_bonus(const struct player *pplayer, const struct tile *ptile, const struct unit_type *punittype, const struct action *paction, enum effect_type effect_type)
unsigned int genhash_val_t
void do_log(const char *file, const char *function, int line, bool print_from_where, enum log_level level, const char *message,...)
#define fc_assert_msg(condition, message,...)
#define fc_assert_ret(condition)
#define fc_assert(condition)
#define fc_assert_full(file, function, line, condition, action, message,...)
#define fc_assert_ret_msg(condition, message,...)
#define fc_assert_ret_val(condition, val)
#define log_debug(message,...)
#define log_error(message,...)
#define fc_assert_ret_val_msg(condition, val, message,...)
const char * dir_get_name(enum direction8 dir)
struct tile * index_to_tile(const struct civ_map *imap, int mindex)
struct tile * mapstep(const struct civ_map *nmap, const struct tile *ptile, enum direction8 dir)
#define adjc_dir_iterate(nmap, center_tile, itr_tile, dir_itr)
#define adjc_dir_iterate_end
#define fc_calloc(n, esz)
#define fc_realloc(ptr, sz)
int unit_move_rate(const struct unit *punit)
int utype_move_rate(const struct unit_type *utype, const struct tile *ptile, const struct player *pplayer, int veteran_level, int hitpoints)
static struct pf_path * pf_fuel_map_path(struct pf_map *pfm, struct tile *ptile)
bool pf_reverse_map_unit_position(struct pf_reverse_map *pfrm, const struct unit *punit, struct pf_position *pos)
static void pf_danger_map_fill_position(const struct pf_danger_map *pfdm, struct tile *ptile, struct pf_position *pos)
struct pf_path * pf_path_concat(struct pf_path *dest_path, const struct pf_path *src_path)
static bool pf_fuel_map_iterate(struct pf_map *pfm)
static const struct pf_position * pf_reverse_map_pos(struct pf_reverse_map *pfrm, const struct pf_parameter *param)
static struct pf_map * pf_danger_map_new(const struct pf_parameter *parameter)
const struct pf_parameter * pf_map_parameter(const struct pf_map *pfm)
void pf_path_print_real(const struct pf_path *path, enum log_level level, const char *file, const char *function, int line)
const struct pf_position * pf_path_last_position(const struct pf_path *path)
void pf_path_destroy(struct pf_path *path)
#define PF_DANGER_MAP(pfm)
static bool pf_normal_node_init(struct pf_normal_map *pfnm, struct pf_normal_node *node, struct tile *ptile, enum pf_move_scope previous_scope)
static struct pf_path * pf_danger_map_construct_path(const struct pf_danger_map *pfdm, struct tile *ptile)
static bool pf_danger_node_init(struct pf_danger_map *pfdm, struct pf_danger_node *node, struct tile *ptile, enum pf_move_scope previous_scope)
static const size_t signifiant_flags_num
bool pf_path_backtrack(struct pf_path *path, struct tile *ptile)
static void pf_fuel_finalize_position_base(const struct pf_parameter *param, struct pf_position *pos, int cost, int moves_left)
static int pf_normal_map_move_cost(struct pf_map *pfm, struct tile *ptile)
static int pf_fuel_map_fill_cost_for_full_moves(const struct pf_parameter *param, int cost, int moves_left)
struct pf_map * pf_map_new(const struct pf_parameter *parameter)
static const struct pf_position * pf_reverse_map_unit_pos(struct pf_reverse_map *pfrm, const struct unit *punit)
static bool pf_fuel_map_position(struct pf_map *pfm, struct tile *ptile, struct pf_position *pos)
static void pf_fuel_map_fill_position(const struct pf_fuel_map *pffm, struct tile *ptile, struct pf_position *pos)
struct pf_path * pf_map_path(struct pf_map *pfm, struct tile *ptile)
bool pf_map_iterate(struct pf_map *pfm)
static void pf_fuel_map_create_segment(struct pf_fuel_map *pffm, struct tile *ptile, struct pf_fuel_node *node)
static bool pf_pos_hash_cmp(const struct pf_parameter *parameter1, const struct pf_parameter *parameter2)
bool pf_map_position(struct pf_map *pfm, struct tile *ptile, struct pf_position *pos)
static int pf_move_rate(const struct pf_parameter *param)
void pf_map_iter_position(struct pf_map *pfm, struct pf_position *pos)
int pf_map_iter_move_cost(struct pf_map *pfm)
static bool pf_jumbo_map_iterate(struct pf_map *pfm)
static int pf_normal_map_adjust_cost(int cost, int moves_left)
static bool pf_normal_map_iterate_until(struct pf_normal_map *pfnm, struct tile *ptile)
static bool pf_fuel_node_init(struct pf_fuel_map *pffm, struct pf_fuel_node *node, struct tile *ptile, enum pf_move_scope previous_scope)
static struct pf_path * pf_danger_map_path(struct pf_map *pfm, struct tile *ptile)
static genhash_val_t pf_pos_hash_val(const struct pf_parameter *parameter)
static struct pf_map * pf_normal_map_new(const struct pf_parameter *parameter)
static struct pf_path * pf_normal_map_path(struct pf_map *pfm, struct tile *ptile)
static struct pf_fuel_pos * pf_fuel_pos_replace(struct pf_fuel_pos *pos, const struct pf_fuel_node *node)
static struct pf_path * pf_normal_map_construct_path(const struct pf_normal_map *pfnm, struct tile *dest_tile)
static bool pf_danger_map_position(struct pf_map *pfm, struct tile *ptile, struct pf_position *pos)
struct pf_reverse_map * pf_reverse_map_new_for_city(const struct civ_map *nmap, const struct city *pcity, const struct player *attacker, int max_turns, bool omniscient)
static int pf_moves_left_initially(const struct pf_parameter *param)
static void pf_reverse_map_destroy_pos(struct pf_position *pos)
static struct pf_fuel_pos * pf_fuel_pos_ref(struct pf_fuel_pos *pos)
static int pf_danger_map_move_cost(struct pf_map *pfm, struct tile *ptile)
static bool pf_fuel_map_attack_is_possible(const struct pf_parameter *param, int moves_left, int moves_left_req)
static enum unit_type_flag_id signifiant_flags[]
static void pf_finalize_position(const struct pf_parameter *param, struct pf_position *pos)
void pf_reverse_map_destroy(struct pf_reverse_map *pfrm)
struct pf_path * pf_map_iter_path(struct pf_map *pfm)
static void pf_fuel_finalize_position(struct pf_position *pos, const struct pf_parameter *params, const struct pf_fuel_node *node, const struct pf_fuel_pos *head)
static void pf_normal_map_fill_position(const struct pf_normal_map *pfnm, struct tile *ptile, struct pf_position *pos)
static int pf_fuel_map_adjust_cost(int cost, int moves_left, int move_rate)
static bool pf_danger_map_iterate(struct pf_map *pfm)
static int pf_fuel_map_move_cost(struct pf_map *pfm, struct tile *ptile)
static void pf_position_fill_start_tile(struct pf_position *pos, const struct pf_parameter *param)
static void pf_fuel_pos_unref(struct pf_fuel_pos *pos)
int pf_reverse_map_unit_move_cost(struct pf_reverse_map *pfrm, const struct unit *punit)
static bool pf_normal_map_position(struct pf_map *pfm, struct tile *ptile, struct pf_position *pos)
static struct pf_path * pf_path_new_to_start_tile(const struct pf_parameter *param)
static int pf_total_CC(const struct pf_parameter *param, unsigned cost, unsigned extra)
static bool pf_fuel_node_dangerous(const struct pf_fuel_node *node)
static void pf_danger_map_destroy(struct pf_map *pfm)
static bool pf_normal_map_iterate(struct pf_map *pfm)
void pf_map_destroy(struct pf_map *pfm)
static int pf_moves_left(const struct pf_parameter *param, int cost)
struct tile * pf_map_iter(struct pf_map *pfm)
static int pf_danger_map_adjust_cost(const struct pf_parameter *params, int cost, bool to_danger, int moves_left)
struct pf_reverse_map * pf_reverse_map_new(const struct civ_map *nmap, const struct player *pplayer, struct tile *target_tile, int max_turns, bool omniscient)
static const struct pf_position * pf_reverse_map_utype_pos(struct pf_reverse_map *pfrm, const struct unit_type *punittype, struct tile *ptile)
static bool pf_fuel_map_iterate_until(struct pf_fuel_map *pffm, struct tile *ptile)
static void pf_normal_map_destroy(struct pf_map *pfm)
int pf_map_move_cost(struct pf_map *pfm, struct tile *ptile)
bool pf_path_advance(struct pf_path *path, struct tile *ptile)
static int pf_fuel_total_CC(const struct pf_parameter *param, int cost, int extra, int safety)
static void pf_fuel_map_destroy(struct pf_map *pfm)
int pf_reverse_map_utype_move_cost(struct pf_reverse_map *pfrm, const struct unit_type *punittype, struct tile *ptile)
static struct pf_map * pf_fuel_map_new(const struct pf_parameter *parameter)
static struct pf_path * pf_fuel_map_construct_path(const struct pf_fuel_map *pffm, struct tile *ptile)
static bool pf_danger_map_iterate_until(struct pf_danger_map *pfdm, struct tile *ptile)
bool pf_reverse_map_utype_position(struct pf_reverse_map *pfrm, const struct unit_type *punittype, struct tile *ptile, struct pf_position *pos)
#define INITIAL_QUEUE_SIZE
static int pf_danger_map_fill_cost_for_full_moves(const struct pf_parameter *param, int cost)
#define PF_NORMAL_MAP(pfm)
static int pf_turns(const struct pf_parameter *param, int cost)
static int pf_fuel_waited_total_CC(int cost, int safety)
static void pf_reverse_map_destroy_param(struct pf_parameter *param)
static void pf_danger_map_create_segment(struct pf_danger_map *pfdm, struct pf_danger_node *node1)
bool player_can_invade_tile(const struct player *pplayer, const struct tile *ptile)
struct setting_list * level[OLEVELS_NUM]
SPECPQ_PRIORITY_TYPE priority
struct map_index_pq * danger_queue
struct pf_danger_node * lattice
struct map_index_pq * queue
struct pf_danger_node::pf_danger_pos * danger_segment
unsigned short extra_tile
struct map_index_pq * waited_queue
struct map_index_pq * queue
struct pf_fuel_node * lattice
struct pf_fuel_pos * segment
unsigned short cost_to_here[DIR8_MAGIC_MAX]
unsigned short extra_tile
struct pf_fuel_pos * prev
bool(* get_position)(struct pf_map *pfm, struct tile *ptile, struct pf_position *pos)
int(* get_move_cost)(struct pf_map *pfm, struct tile *ptile)
struct pf_path *(* get_path)(struct pf_map *pfm, struct tile *ptile)
bool(* iterate)(struct pf_map *pfm)
void(* destroy)(struct pf_map *pfm)
struct pf_parameter params
struct pf_normal_node * lattice
struct map_index_pq * queue
unsigned short extra_tile
const struct unit_type * transported_by_initially
enum pf_action(* get_action)(const struct tile *ptile, enum known_type known, const struct pf_parameter *param)
enum pf_move_scope(* get_move_scope)(const struct tile *ptile, bool *can_disembark, enum pf_move_scope previous_scope, const struct pf_parameter *param)
const struct civ_map * map
enum tile_behavior(* get_TB)(const struct tile *ptile, enum known_type known, const struct pf_parameter *param)
const struct player * owner
bool(* is_pos_dangerous)(const struct tile *ptile, enum known_type, const struct pf_parameter *param)
int(* get_moves_left_req)(const struct tile *ptile, enum known_type, const struct pf_parameter *param)
bool(* get_zoc)(const struct player *pplayer, const struct tile *ptile, const struct civ_map *zmap)
unsigned(* get_MC)(const struct tile *from_tile, enum pf_move_scope src_move_scope, const struct tile *to_tile, enum pf_move_scope dst_move_scope, const struct pf_parameter *param)
int(* get_costs)(const struct tile *from_tile, enum direction8 dir, const struct tile *to_tile, int from_cost, int from_extra, unsigned *to_cost, unsigned *to_extra, const struct pf_parameter *param)
unsigned(* get_EC)(const struct tile *ptile, enum known_type known, const struct pf_parameter *param)
const struct unit_type * utype
bool(* is_action_possible)(const struct tile *from_tile, enum pf_move_scope src_move_scope, const struct tile *to_tile, enum pf_action action, const struct pf_parameter *param)
struct pf_position * positions
enum direction8 dir_to_next_pos
struct pf_parameter template
struct pf_pos_hash * hash
struct tile * target_tile
#define terrain_has_flag(terr, flag)
bool tile_has_native_base(const struct tile *ptile, const struct unit_type *punittype)
enum known_type tile_get_known(const struct tile *ptile, const struct player *pplayer)
struct city * tile_city(const struct tile *ptile)
#define tile_terrain(_tile)
bool utype_action_takes_all_mp(const struct unit_type *putype, struct action *paction)
const struct unit_type * unit_type_get(const struct unit *punit)
bool utype_can_freely_unload(const struct unit_type *pcargotype, const struct unit_type *ptranstype)
int utype_veteran_levels(const struct unit_type *punittype)
Unit_Class_id uclass_number(const struct unit_class *pclass)
bool utype_can_do_action(const struct unit_type *putype, const action_id act_id)
static bool utype_has_flag(const struct unit_type *punittype, int flag)