33 const struct
city *pcity)
45 const struct unit *punit)
61 return QStringLiteral(
"(invalid tech)");
65 return QString::asprintf(
85 return QString::asprintf(
89 adip->is_allied_with_enemy ?
"?"
90 : (adip->at_war_with_ally ?
"!" :
""));
100 const struct unit *pcharge;
101 const struct city *pcity;
105 const char *type =
"guard";
106 const char *s =
"none";
124 return QString::asprintf(
125 "%s %s[%d] %s (%d,%d){%s:%d@%d,%d} ",
struct ai_dip_intel * dai_diplomacy_get(struct ai_type *ait, const struct player *plr1, const struct player *plr2)
Returns diplomatic state type between two players.
QString diplo_log_prefix(ai_type *ait, const player *pplayer, const player *aplayer)
Log player messages, they will appear like this.
void dai_unit_log(struct ai_type *ait, char *buffer, int buflength, const struct unit *punit)
Produce logline fragment for srv_log.
QString bodyguard_log_prefix(ai_type *ait, const unit *punit)
Log message for bodyguards.
QString tech_log_prefix(ai_type *ait, const player *pplayer, advance *padvance)
Log player tech messages.
void dai_city_log(struct ai_type *ait, char *buffer, int buflength, const struct city *pcity)
Produce logline fragment for srv_log.
static struct ai_plr * def_ai_player_data(const struct player *pplayer, struct ai_type *deftype)
static struct ai_city * def_ai_city_data(const struct city *pcity, struct ai_type *deftype)
static struct unit_ai * def_ai_unit_data(const struct unit *punit, struct ai_type *deftype)
struct tile * city_tile(const struct city *pcity)
Return the tile location of the city.
const char * city_name_get(const struct city *pcity)
Return the name of the city.
struct unit * game_unit_by_number(int id)
Find unit out of all units in game: now uses fast idex method, instead of looking through all units o...
struct city * game_city_by_number(int id)
Often used function to get a city pointer from a city ID.
#define index_to_map_pos(pmap_x, pmap_y, mindex)
const char * nation_rule_name(const struct nation_type *pnation)
Return the (untranslated) rule name of the nation (adjective form).
struct nation_type * nation_of_unit(const struct unit *punit)
Return the nation of the player who owns the unit.
int player_index(const struct player *pplayer)
Return the player index.
const char * player_name(const struct player *pplayer)
Return the leader name of the player.
int research_goal_unknown_techs(const struct research *presearch, Tech_type_id goal)
Returns the number of technologies the player need to research to get the goal technology.
struct research * research_get(const struct player *pplayer)
Returns the research structure associated with the player.
int love[MAX_NUM_PLAYER_SLOTS]
struct player_ai ai_common
int fc_snprintf(char *str, size_t n, const char *format,...)
See also fc_utf8_snprintf_trunc(), fc_utf8_snprintf_rep().
struct advance * valid_advance(struct advance *padvance)
Returns pointer when the advance "exists" in this game, returns nullptr otherwise.
const char * advance_rule_name(const struct advance *padvance)
Return the (untranslated) rule name of the advance/technology.
struct advance * advance_by_number(const Tech_type_id atype)
Return the advance for the given advance index.
Tech_type_id advance_index(const struct advance *padvance)
Return the advance index.
Tech_type_id advance_number(const struct advance *padvance)
Return the advance index.
Q_LOGGING_CATEGORY(tileset_category, "freeciv.tileset")
Functions for handling the tilespec files which describe the files and contents of tilesets.
const char * unit_rule_name(const struct unit *punit)
Return the (untranslated) rule name of the unit.