Freeciv-3.3
Loading...
Searching...
No Matches
texaimsg.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/* ai/tex */
19#include "texaiplayer.h"
20
21#include "texaimsg.h"
22
23/**********************************************************************/
26void texai_send_msg(enum texaimsgtype type, struct player *pplayer,
27 void *data)
28{
29 struct texai_msg *msg;
30
31 if (!texai_thread_running()) {
32 /* No player thread to send messages to */
33 return;
34 }
35
36 msg = fc_malloc(sizeof(*msg));
37
38 msg->type = type;
39 msg->plr = pplayer;
40 msg->data = data;
41
43}
44
45/**********************************************************************/
48void texai_send_req(enum texaireqtype type, struct player *pplayer,
49 void *data)
50{
51 struct texai_req *req = fc_malloc(sizeof(*req));
52
53 req->type = type;
54 req->plr = pplayer;
55 req->data = data;
56
58}
59
60/**********************************************************************/
63void texai_first_activities(struct ai_type *ait, struct player *pplayer)
64{
66}
67
68/**********************************************************************/
71void texai_phase_finished(struct ai_type *ait, struct player *pplayer)
72{
74}
char * incite_cost
Definition comments.c:76
GType type
Definition repodlgs.c:1313
#define fc_malloc(sz)
Definition mem.h:34
Definition ai.h:50
struct player * plr
Definition texaimsg.h:57
enum texaimsgtype type
Definition texaimsg.h:56
void * data
Definition texaimsg.h:58
void * data
Definition texaimsg.h:65
enum texaireqtype type
Definition texaimsg.h:63
struct player * plr
Definition texaimsg.h:64
void texai_first_activities(struct ai_type *ait, struct player *pplayer)
Definition texaimsg.c:63
void texai_send_msg(enum texaimsgtype type, struct player *pplayer, void *data)
Definition texaimsg.c:26
void texai_phase_finished(struct ai_type *ait, struct player *pplayer)
Definition texaimsg.c:71
void texai_send_req(enum texaireqtype type, struct player *pplayer, void *data)
Definition texaimsg.c:48
bool texai_thread_running(void)
void texai_req_from_thr(struct texai_req *req)
void texai_msg_to_thr(struct texai_msg *msg)