Freeciv-3.3: /fast/freeciv/nightly/main/ai/tex/texaiplayer.h Source File

Freeciv-3.3

Loading...
Searching...
No Matches
texaiplayer.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__TEXAIPLAYER_H
14#define FC__TEXAIPLAYER_H
15
16/* utility */
17#include "fcthread.h"
18
19/* common */
20#include "player.h"
21
22/* ai/default */
23#include "daidata.h"
24
25/* ai/tex */
26#include "texaimsg.h"
27
28struct player;
29
30 struct texai_msgs
31{
32 fc_thread_cond thr_cond;
33 fc_mutex mutex;
34 struct texaimsg_list *msglist;
35};
36
37 struct texai_reqs
38{
39 struct texaireq_list *reqlist;
40};
41
42 struct texai_plr
43{
44 struct ai_plr defai; /* Keep this first so default AI finds it */
45 struct unit_list *units;
46 struct city_list *cities;
47};
48
49struct ai_type *texai_get_self(void); /* Actually in texai.c */
50
51void texai_init_threading(void);
52
53bool texai_thread_running(void);
54
55void texai_map_alloc(void);
56void texai_whole_map_copy(void);
57void texai_map_free(void);
58void texai_player_alloc(struct ai_type *ait, struct player *pplayer);
59void texai_player_free(struct ai_type *ait, struct player *pplayer);
60void texai_control_gained(struct ai_type *ait, struct player *pplayer);
61void texai_control_lost(struct ai_type *ait, struct player *pplayer);
62void texai_refresh(struct ai_type *ait, struct player *pplayer);
63
64void texai_msg_to_thr(struct texai_msg *msg);
65
66void texai_req_from_thr(struct texai_req *req);
67
68 static inline struct texai_plr *texai_player_data(struct ai_type *ait,
69 const struct player *pplayer)
70{
71 return (struct texai_plr *)player_ai_data(pplayer, ait);
72}
73
74struct unit_list *texai_player_units(struct player *pplayer);
75
76#endif /* FC__TEXAIPLAYER_H */
incite_cost
char * incite_cost
Definition comments.c:74
daidata.h
fcthread.h
player_ai_data
void * player_ai_data(const struct player *pplayer, const struct ai_type *ai)
Definition player.c:1944
player.h
ai_plr
Definition daidata.h:71
ai_type
Definition ai.h:50
player
Definition player.h:249
texai_msg
Definition texaimsg.h:55
texai_msgs
Definition texaiplayer.h:31
texai_msgs::mutex
fc_mutex mutex
Definition texaiplayer.h:33
texai_msgs::thr_cond
fc_thread_cond thr_cond
Definition texaiplayer.h:32
texai_msgs::msglist
struct texaimsg_list * msglist
Definition texaiplayer.h:34
texai_plr
Definition texaiplayer.h:43
texai_plr::defai
struct ai_plr defai
Definition texaiplayer.h:44
texai_plr::units
struct unit_list * units
Definition texaiplayer.h:45
texai_plr::cities
struct city_list * cities
Definition texaiplayer.h:46
texai_req
Definition texaimsg.h:62
texai_reqs
Definition texaiplayer.h:38
texai_reqs::reqlist
struct texaireq_list * reqlist
Definition texaiplayer.h:39
texaimsg.h
texai_player_alloc
void texai_player_alloc(struct ai_type *ait, struct player *pplayer)
Definition texaiplayer.c:278
texai_control_gained
void texai_control_gained(struct ai_type *ait, struct player *pplayer)
Definition texaiplayer.c:312
texai_player_free
void texai_player_free(struct ai_type *ait, struct player *pplayer)
Definition texaiplayer.c:294
texai_player_units
struct unit_list * texai_player_units(struct player *pplayer)
Definition texaiplayer.c:156
texai_thread_running
bool texai_thread_running(void)
Definition texaiplayer.c:435
texai_control_lost
void texai_control_lost(struct ai_type *ait, struct player *pplayer)
Definition texaiplayer.c:343
texai_req_from_thr
void texai_req_from_thr(struct texai_req *req)
Definition texaiplayer.c:425
texai_get_self
struct ai_type * texai_get_self(void)
Definition texai.c:61
texai_refresh
void texai_refresh(struct ai_type *ait, struct player *pplayer)
Definition texaiplayer.c:366
texai_init_threading
void texai_init_threading(void)
Definition texaiplayer.c:73
texai_msg_to_thr
void texai_msg_to_thr(struct texai_msg *msg)
Definition texaiplayer.c:414
texai_map_alloc
void texai_map_alloc(void)
Definition texaiplayer.c:114
texai_player_data
static struct texai_plr * texai_player_data(struct ai_type *ait, const struct player *pplayer)
Definition texaiplayer.h:68
texai_whole_map_copy
void texai_whole_map_copy(void)
Definition texaiplayer.c:122
texai_map_free
void texai_map_free(void)
Definition texaiplayer.c:140