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
36
38{
40};
41
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
68static 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 */
char * incite_cost
Definition comments.c:76
void * player_ai_data(const struct player *pplayer, const struct ai_type *ai)
Definition player.c:1946
Definition ai.h:50
fc_mutex mutex
Definition texaiplayer.h:33
fc_thread_cond thr_cond
Definition texaiplayer.h:32
struct texaimsg_list * msglist
Definition texaiplayer.h:34
struct ai_plr defai
Definition texaiplayer.h:44
struct unit_list * units
Definition texaiplayer.h:45
struct city_list * cities
Definition texaiplayer.h:46
struct texaireq_list * reqlist
Definition texaiplayer.h:39
void texai_player_alloc(struct ai_type *ait, struct player *pplayer)
void texai_control_gained(struct ai_type *ait, struct player *pplayer)
void texai_player_free(struct ai_type *ait, struct player *pplayer)
struct unit_list * texai_player_units(struct player *pplayer)
bool texai_thread_running(void)
void texai_control_lost(struct ai_type *ait, struct player *pplayer)
void texai_req_from_thr(struct texai_req *req)
struct ai_type * texai_get_self(void)
Definition texai.c:61
void texai_refresh(struct ai_type *ait, struct player *pplayer)
void texai_init_threading(void)
Definition texaiplayer.c:73
void texai_msg_to_thr(struct texai_msg *msg)
void texai_map_alloc(void)
static struct texai_plr * texai_player_data(struct ai_type *ait, const struct player *pplayer)
Definition texaiplayer.h:68
void texai_whole_map_copy(void)
void texai_map_free(void)