37#ifdef AI_MOD_STATIC_THREADED
41#ifdef AI_MOD_STATIC_TEX
45#ifdef AI_MOD_STATIC_STUB
57 static char def_err[] =
"Unknown error";
76 const char *(*capstr_func)(
void);
88 fc_snprintf(buffer,
sizeof(buffer),
"%s", filename);
95 fc_snprintf(buffer,
sizeof(buffer),
"%s_capstr", filename);
98 log_error(
_(
"Cannot find capstr function from ai module %s (%s)"),
105 log_error(
_(
"Incompatible ai module %s:"), filename);
112 fc_snprintf(buffer,
sizeof(buffer),
"%s_setup", filename);
115 log_error(
_(
"Cannot find setup function from ai module %s (%s)"),
122 log_error(
_(
"Setup of ai module %s failed."), filename);
136#if !defined(AI_MODULES) || defined(AI_MOD_STATIC_CLASSIC) || defined(AI_MOD_STATIC_THREADED) || defined(AI_MOD_STATIC_TEX) || defined(AI_MOD_STATIC_STUB)
151 const char *
moduledirs[] = {
"classic",
"threaded",
"tex",
"stub",
NULL };
167#ifdef AI_MOD_STATIC_CLASSIC
172 log_error(
_(
"Failed to setup \"%s\" AI module"),
"classic");
178#ifdef AI_MOD_STATIC_THREADED
183 log_error(
_(
"Failed to setup \"%s\" AI module"),
"threaded");
189#ifdef AI_MOD_STATIC_TEX
194 log_error(
_(
"Failed to setup \"%s\" AI module"),
"tex");
200#ifdef AI_MOD_STATIC_STUB
205 log_error(
_(
"Failed to setup \"%s\" AI module"),
"stub");
224 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::@31::@35 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)