35#ifdef AI_MOD_STATIC_TEX
39#ifdef AI_MOD_STATIC_STUB
51 static char def_err[] =
"Unknown error";
70 const char *(*capstr_func)(
void);
82 fc_snprintf(buffer,
sizeof(buffer),
"%s", filename);
89 fc_snprintf(buffer,
sizeof(buffer),
"%s_capstr", filename);
92 log_error(
_(
"Cannot find capstr function from ai module %s (%s)"),
99 log_error(
_(
"Incompatible ai module %s:"), filename);
106 fc_snprintf(buffer,
sizeof(buffer),
"%s_setup", filename);
109 log_error(
_(
"Cannot find setup function from ai module %s (%s)"),
116 log_error(
_(
"Setup of ai module %s failed."), filename);
130#if !defined(AI_MODULES) || defined(AI_MOD_STATIC_CLASSIC) || defined(AI_MOD_STATIC_TEX) || defined(AI_MOD_STATIC_STUB)
145 const char *
moduledirs[] = {
"classic",
"threaded",
"tex",
"stub",
NULL };
161#ifdef AI_MOD_STATIC_CLASSIC
166 log_error(
_(
"Failed to setup \"%s\" AI module"),
"classic");
172#ifdef AI_MOD_STATIC_TEX
177 log_error(
_(
"Failed to setup \"%s\" AI module"),
"tex");
183#ifdef AI_MOD_STATIC_STUB
188 log_error(
_(
"Failed to setup \"%s\" AI module"),
"stub");
207 log_error(
_(
"Failed to setup default AI module \"%s\", cannot continue."),
void init_ai(struct ai_type *ai)
struct ai_type * ai_type_alloc(void)
struct ai_type * ai_type_by_name(const char *search)
void ai_type_dealloc(void)
#define CALL_PLR_AI_FUNC(_func, _player,...)
void call_incident(enum incident_type type, enum casus_belli_range scope, const struct action *paction, struct player *violator, struct player *victim)
bool set_default_ai_type_name(const char *name)
void call_ai_refresh(void)
static struct ai_type * default_ai
const char * default_ai_type_name(void)
bool load_ai_module(const char *modname)
bool fc_ai_classic_setup(struct ai_type *ai)
#define fc_assert(condition)
#define log_error(message,...)
#define players_iterate_end
#define players_iterate(_pplayer)
void(* refresh)(struct player *pplayer)
void(* incident)(enum incident_type type, enum casus_belli_range scope, const struct action *paction, struct player *receiver, struct player *violator, struct player *victim)
char default_ai_type_name[256]
struct civ_game::@32::@36 server
bool fc_ai_stub_setup(struct ai_type *ai)
int fc_snprintf(char *str, size_t n, const char *format,...)
bool fc_ai_tex_setup(struct ai_type *ai)