Feature #1786 ยป 0048-access_area-Add-tiledef-information.patch
| common/accessarea.c | ||
|---|---|---|
|
/* common */
|
||
|
#include "player.h"
|
||
|
#include "tiledef.h"
|
||
|
#include "accessarea.h"
|
||
| ... | ... | |
|
struct access_area *aarea = fc_malloc(sizeof(struct access_area));
|
||
|
struct pf_parameter parameter;
|
||
|
struct pf_map *pfm;
|
||
|
int i;
|
||
|
aarea->cities = city_list_new();
|
||
|
aarea->capital = is_capital(pcity);
|
||
| ... | ... | |
|
}
|
||
|
} city_list_iterate_end;
|
||
|
BV_CLR_ALL(aarea->tiledefs);
|
||
|
for (i = 0; i < MAX_TILEDEFS; i++) {
|
||
|
pf_map_tiles_iterate(pfm, ptile, TRUE) {
|
||
|
if (tile_matches_tiledef(tiledef_by_number(i), ptile)) {
|
||
|
BV_SET(aarea->tiledefs, i);
|
||
|
break;
|
||
|
}
|
||
|
} pf_map_tiles_iterate_end;
|
||
|
}
|
||
|
pf_map_destroy(pfm);
|
||
|
}
|
||
|
} city_list_iterate_end;
|
||
| common/fc_types.h | ||
|---|---|---|
|
#define SPECENUM_VALUE1NAME "Founded"
|
||
|
#include "specenum_gen.h"
|
||
|
BV_DEFINE(bv_tiledefs, MAX_TILEDEFS);
|
||
|
struct access_area {
|
||
|
const struct player *plr;
|
||
|
struct city_list *cities;
|
||
|
bool capital;
|
||
|
bv_tiledefs tiledefs;
|
||
|
};
|
||
|
#ifdef __cplusplus
|
||