Freeciv-3.3: /fast/freeciv/nightly/main/ai/default/daiplayer.h Source File

Freeciv-3.3

Loading...
Searching...
No Matches
daiplayer.h
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#ifndef FC__DAIPLAYER_H
14#define FC__DAIPLAYER_H
15
16/* common */
17#include "city.h"
18#include "player.h"
19
20struct player;
21struct ai_plr;
22
23void dai_player_alloc(struct ai_type *ait, struct player *pplayer);
24void dai_player_free(struct ai_type *ait, struct player *pplayer);
25void dai_player_save(struct ai_type *ait, const char *aitstr,
26 struct player *pplayer, struct section_file *file,
27 int plrno);
28void dai_player_save_relations(struct ai_type *ait, const char *aitstr,
29 struct player *pplayer, struct player *other,
30 struct section_file *file, int plrno);
31void dai_player_load(struct ai_type *ait, const char *aitstr,
32 struct player *pplayer, const struct section_file *file,
33 int plrno);
34void dai_player_load_relations(struct ai_type *ait, const char *aitstr,
35 struct player *pplayer, struct player *other,
36 const struct section_file *file, int plrno);
37
38void dai_player_copy(struct ai_type *ait,
39 struct player *original, struct player *created);
40void dai_gained_control(struct ai_type *ait, struct player *pplayer);
41
42 static inline struct ai_city *def_ai_city_data(const struct city *pcity,
43 struct ai_type *deftype)
44{
45 return (struct ai_city *)city_ai_data(pcity, deftype);
46}
47
48 static inline struct unit_ai *def_ai_unit_data(const struct unit *punit,
49 struct ai_type *deftype)
50{
51 return (struct unit_ai *)unit_ai_data(punit, deftype);
52}
53
54 static inline struct ai_plr *def_ai_player_data(const struct player *pplayer,
55 struct ai_type *deftype)
56{
57 return (struct ai_plr *)player_ai_data(pplayer, deftype);
58}
59
60 struct dai_private_data
61{
62 bool contemplace_workers;
63};
64
65#endif /* FC__DAIPLAYER_H */
city_ai_data
void * city_ai_data(const struct city *pcity, const struct ai_type *ai)
Definition city.c:3605
city.h
incite_cost
char * incite_cost
Definition comments.c:74
def_ai_player_data
static struct ai_plr * def_ai_player_data(const struct player *pplayer, struct ai_type *deftype)
Definition daiplayer.h:54
dai_player_alloc
void dai_player_alloc(struct ai_type *ait, struct player *pplayer)
Definition daiplayer.c:38
dai_player_save
void dai_player_save(struct ai_type *ait, const char *aitstr, struct player *pplayer, struct section_file *file, int plrno)
Definition daiplayer.c:65
def_ai_city_data
static struct ai_city * def_ai_city_data(const struct city *pcity, struct ai_type *deftype)
Definition daiplayer.h:42
def_ai_unit_data
static struct unit_ai * def_ai_unit_data(const struct unit *punit, struct ai_type *deftype)
Definition daiplayer.h:48
dai_player_copy
void dai_player_copy(struct ai_type *ait, struct player *original, struct player *created)
Definition daiplayer.c:151
dai_player_save_relations
void dai_player_save_relations(struct ai_type *ait, const char *aitstr, struct player *pplayer, struct player *other, struct section_file *file, int plrno)
Definition daiplayer.c:77
dai_player_load
void dai_player_load(struct ai_type *ait, const char *aitstr, struct player *pplayer, const struct section_file *file, int plrno)
Definition daiplayer.c:108
dai_player_free
void dai_player_free(struct ai_type *ait, struct player *pplayer)
Definition daiplayer.c:50
dai_gained_control
void dai_gained_control(struct ai_type *ait, struct player *pplayer)
Definition daiplayer.c:174
dai_player_load_relations
void dai_player_load_relations(struct ai_type *ait, const char *aitstr, struct player *pplayer, struct player *other, const struct section_file *file, int plrno)
Definition daiplayer.c:120
punit
struct unit struct city struct unit struct tile struct extra_type const struct act_prob *act_probs int actor_unit_id struct unit struct unit * punit
Definition dialogs_g.h:74
player_ai_data
void * player_ai_data(const struct player *pplayer, const struct ai_type *ai)
Definition player.c:1946
player.h
ai_city
Definition daicity.h:34
ai_plr
Definition daidata.h:71
ai_type
Definition ai.h:50
city
Definition city.h:320
dai_private_data
Definition daiplayer.h:61
dai_private_data::contemplace_workers
bool contemplace_workers
Definition daiplayer.h:62
player
Definition player.h:249
section_file
Definition section_file.h:36
unit_ai
Definition daiunit.h:32
unit
Definition unit.h:140
unit_ai_data
void * unit_ai_data(const struct unit *punit, const struct ai_type *ai)
Definition unit.c:2320