Freeciv-3.2
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
42static 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
48static 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
54static 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
64
65#endif /* FC__DAIPLAYER_H */
void * city_ai_data(const struct city *pcity, const struct ai_type *ai)
Definition city.c:3609
char * incite_cost
Definition comments.c:75
static struct ai_plr * def_ai_player_data(const struct player *pplayer, struct ai_type *deftype)
Definition daiplayer.h:54
void dai_player_alloc(struct ai_type *ait, struct player *pplayer)
Definition daiplayer.c:38
void dai_player_save(struct ai_type *ait, const char *aitstr, struct player *pplayer, struct section_file *file, int plrno)
Definition daiplayer.c:65
static struct ai_city * def_ai_city_data(const struct city *pcity, struct ai_type *deftype)
Definition daiplayer.h:42
static struct unit_ai * def_ai_unit_data(const struct unit *punit, struct ai_type *deftype)
Definition daiplayer.h:48
void dai_player_copy(struct ai_type *ait, struct player *original, struct player *created)
Definition daiplayer.c:151
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
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
void dai_player_free(struct ai_type *ait, struct player *pplayer)
Definition daiplayer.c:50
void dai_gained_control(struct ai_type *ait, struct player *pplayer)
Definition daiplayer.c:174
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
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
void * player_ai_data(const struct player *pplayer, const struct ai_type *ai)
Definition player.c:1940
Definition ai.h:50
Definition city.h:320
bool contemplace_workers
Definition daiplayer.h:62
Definition unit.h:138
void * unit_ai_data(const struct unit *punit, const struct ai_type *ai)
Definition unit.c:2282