35#ifdef AI_MOD_STATIC_THREADED
39#ifdef AI_MOD_STATIC_TEX
43#ifdef AI_MOD_STATIC_STUB
55 static char def_err[] =
"Unknown error";
74 const char *(*capstr_func)(
void);
86 fc_snprintf(buffer,
sizeof(buffer),
"%s", filename);
93 fc_snprintf(buffer,
sizeof(buffer),
"%s_capstr", filename);
96 log_error(
_(
"Cannot find capstr function from ai module %s (%s)"),
103 log_error(
_(
"Incompatible ai module %s:"), filename);
110 fc_snprintf(buffer,
sizeof(buffer),
"%s_setup", filename);
113 log_error(
_(
"Cannot find setup function from ai module %s (%s)"),
120 log_error(
_(
"Setup of ai module %s failed."), filename);
134#if !defined(AI_MODULES) || defined(AI_MOD_STATIC_CLASSIC) || defined(AI_MOD_STATIC_THREADED) || defined(AI_MOD_STATIC_TEX) || defined(AI_MOD_STATIC_STUB)
149 const char *
moduledirs[] = {
"classic",
"threaded",
"tex",
"stub",
NULL };
165#ifdef AI_MOD_STATIC_CLASSIC
170 log_error(
_(
"Failed to setup \"%s\" AI module"),
"classic");
176#ifdef AI_MOD_STATIC_THREADED
181 log_error(
_(
"Failed to setup \"%s\" AI module"),
"threaded");
187#ifdef AI_MOD_STATIC_TEX
192 log_error(
_(
"Failed to setup \"%s\" AI module"),
"tex");
198#ifdef AI_MOD_STATIC_STUB
203 log_error(
_(
"Failed to setup \"%s\" AI module"),
"stub");
222 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)