Freeciv-3.1: /fast/freeciv/nightly/S3_1/ai/stub/stubai.c Source File

Freeciv-3.1

Loading...
Searching...
No Matches
stubai.c
Go to the documentation of this file.
1/***********************************************************************
2 Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2, or (at your option)
6 any later version.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12***********************************************************************/
13
14#ifdef HAVE_CONFIG_H
15#include <fc_config.h>
16#endif
17
18/* common */
19#include "ai.h"
20#include "player.h"
21
22const char *fc_ai_stub_capstr(void);
23bool fc_ai_stub_setup(struct ai_type *ai);
24
25/**********************************************************************/
28 const char *fc_ai_stub_capstr(void)
29{
30 return FC_AI_MOD_CAPSTR;
31}
32
33/**********************************************************************/
36 static void stub_end_turn(struct player *pplayer)
37{
38 pplayer->ai_phase_done = TRUE;
39}
40
41/**********************************************************************/
44 bool fc_ai_stub_setup(struct ai_type *ai)
45{
46 strncpy(ai->name, "stub", sizeof(ai->name));
47
48 ai->funcs.first_activities = stub_end_turn;
49 ai->funcs.restart_phase = stub_end_turn;
50
51 return TRUE;
52}
ai.h
FC_AI_MOD_CAPSTR
#define FC_AI_MOD_CAPSTR
Definition ai.h:27
player.h
ai_type
Definition ai.h:50
ai_type::restart_phase
void(* restart_phase)(struct player *pplayer)
Definition ai.h:250
ai_type::funcs
struct ai_type::@14 funcs
ai_type::name
char name[MAX_LEN_NAME]
Definition ai.h:51
ai_type::first_activities
void(* first_activities)(struct player *pplayer)
Definition ai.h:247
player
Definition player.h:249
player::ai_phase_done
bool ai_phase_done
Definition player.h:264
fc_ai_stub_setup
bool fc_ai_stub_setup(struct ai_type *ai)
Definition stubai.c:44
fc_ai_stub_capstr
const char * fc_ai_stub_capstr(void)
Definition stubai.c:28
stub_end_turn
static void stub_end_turn(struct player *pplayer)
Definition stubai.c:36
TRUE
#define TRUE
Definition support.h:46