45 char aibuf[500] =
"\0";
47 sizeof(aibuf), pcity);
49 return QString::asprintf(
"%s %s(%d,%d) (s%d) {%s} ",
64 char aibuf[500] =
"\0";
67 sizeof(aibuf), punit);
75 return QString::asprintf(
"%s %s(%d) %s (%d,%d)->(%d,%d){%s} ",
118 #define AILOG_OUT(text, which) \
119 fc_snprintf(buf, sizeof(buf), " %s: %g sec turn, %g sec game", text, \
120 timer_read_seconds(aitimer[which][0]), \
121 timer_read_seconds(aitimer[which][1])); \
122 qCInfo(timers_category, "%s", buf); \
123 notify_conn(nullptr, nullptr, E_AI_DEBUG, ftc_log, "%s", buf);
125 qCInfo(timers_category,
" --- AI timing results ---");
128 " --- AI timing results ---");
#define CALL_PLR_AI_FUNC(_func, _player,...)
struct player * city_owner(const struct city *pcity)
Return the owner of the city.
const char * city_name_get(const struct city *pcity)
Return the name of the city.
citizens city_size_get(const struct city *pcity)
Get the city size.
const struct ft_color ftc_log
#define fc_assert(condition)
#define index_to_map_pos(pmap_x, pmap_y, mindex)
struct nation_type * nation_of_city(const struct city *pcity)
Return the nation of the player who owns the city.
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.
void notify_conn(struct conn_list *dest, const struct tile *ptile, enum event_type event, const struct ft_color color, const char *format,...)
See notify_conn_packet - this is just the "non-v" version, with varargs.
void timing_log_init()
Initialize AI timing system.
void timing_log_free()
Free AI timing system resources.
QString unit_log_prefix(const unit *punit)
Log a unit, it will appear like this Polish Archers[139] (5,35)->(0,0){0,0} where [] is unit id,...
QString city_log_prefix(const city *pcity)
Log a city, it will appear like this Polish Romenna(5,35) [s1 d106 u11 g1].
static int recursion[AIT_LAST]
#define AILOG_OUT(text, which)
void timing_log_real(enum ai_timer timer, enum ai_timer_activity activity)
Measure the time between the calls.
static civtimer * aitimer[AIT_LAST][2]
void timing_results_real()
Print results.
struct packet_game_info info
enum unit_activity activity
void timer_destroy(civtimer *t)
Deletes timer.
civtimer * timer_new(enum timer_timetype type, enum timer_use use)
Allocate a new timer with specified "type" and "use".
void timer_start(civtimer *t)
Start timing, adding to previous accumulated time if timer has not been cleared.
void timer_clear(civtimer *t)
Reset accumulated time to zero, and stop timer if going.
void timer_stop(civtimer *t)
Stop timing, and accumulate time so far.
const char * get_activity_text(enum unit_activity activity)
Return the name of the activity in a static buffer.
const char * unit_rule_name(const struct unit *punit)
Return the (untranslated) rule name of the unit.