45 #define log_citymap log_debug
72 if (
nullptr != pwork) {
struct tile * city_tile(const struct city *pcity)
Return the tile location of the city.
int city_map_radius_sq_get(const struct city *pcity)
Returns the current squared radius of the city.
#define city_list_iterate(citylist, pcity)
#define city_tile_iterate(_radius_sq, _city_tile, _tile)
#define city_list_iterate_end
#define CITY_MAP_DEFAULT_RADIUS_SQ
#define city_tile_iterate_end
void citymap_free_city_spot(struct tile *ptile, int id)
Reverse any reservations we have made in the surrounding area.
void citymap_reserve_tile(struct tile *ptile, int id)
Reserve additional tiles as desired (eg I would reserve best available food tile in addition to adjac...
void citymap_reserve_city_spot(struct tile *ptile, int id)
This function reserves a single tile for a (possibly virtual) city with a settler's or a city's id.
std::vector< int > citymap
bool citymap_is_reserved(struct tile *ptile)
A tile is reserved if it contains a city or unit id, or a worker is assigned to it.
int citymap_read(struct tile *ptile)
Returns a positive value if within a city radius, which is 1 x number of cities you are within the ra...
void citymap_free()
Free resources allocated for citymap.
void citymap_turn_init(struct player *pplayer)
Initialize citymap by reserving worked tiles and establishing the crowdedness of (virtual) cities.
#define fc_assert_ret(condition)
#define players_iterate_end
#define players_iterate(_pplayer)
#define tile_worked(_tile)
bool unit_is_cityfounder(const struct unit *punit)
Is a cityfounder unit?
#define unit_list_iterate(unitlist, punit)
#define unit_list_iterate_end