Freeciv21
Develop your civilization from humble roots to a global empire
taimsg.h
Go to the documentation of this file.
1 /*__ ___ ***************************************
2 / \ / \ Copyright (c) 1996-2020 Freeciv21 and Freeciv
3 \_ \ / __/ contributors. This file is part of Freeciv21.
4  _\ \ / /__ Freeciv21 is free software: you can redistribute it
5  \___ \____/ __/ and/or modify it under the terms of the GNU General
6  \_ _/ Public License as published by the Free Software
7  | @ @ \_ Foundation, either version 3 of the License,
8  | or (at your option) any later version.
9  _/ /\ You should have received a copy of the GNU
10  /o) (o/\ \_ General Public License along with Freeciv21.
11  \_____/ / If not, see https://www.gnu.org/licenses/.
12  \____/ ********************************************************/
13 #pragma once
14 
15 #define SPECENUM_NAME taimsgtype
16 #define SPECENUM_VALUE0 TAI_MSG_THR_EXIT
17 #define SPECENUM_VALUE0NAME "Exit"
18 #define SPECENUM_VALUE1 TAI_MSG_FIRST_ACTIVITIES
19 #define SPECENUM_VALUE1NAME "FirstActivities"
20 #define SPECENUM_VALUE2 TAI_MSG_PHASE_FINISHED
21 #define SPECENUM_VALUE2NAME "PhaseFinished"
22 #include "specenum_gen.h"
23 
24 #define SPECENUM_NAME taireqtype
25 #define SPECENUM_VALUE0 TAI_REQ_WORKER_TASK
26 #define SPECENUM_VALUE0NAME "WorkerTask"
27 #define SPECENUM_VALUE1 TAI_REQ_TURN_DONE
28 #define SPECENUM_VALUE1NAME "TurnDone"
29 #include "specenum_gen.h"
30 
31 struct tai_msg {
32  enum taimsgtype type;
33  struct player *plr;
34  void *data;
35 };
36 
37 struct tai_req {
38  enum taireqtype type;
39  struct player *plr;
40  void *data;
41 };
42 
43 #define SPECLIST_TAG taimsg
44 #define SPECLIST_TYPE struct tai_msg
45 #include "speclist.h"
46 
47 #define SPECLIST_TAG taireq
48 #define SPECLIST_TYPE struct tai_req
49 #include "speclist.h"
50 
51 void tai_send_msg(enum taimsgtype type, struct player *pplayer, void *data);
52 void tai_send_req(enum taireqtype type, struct player *pplayer, void *data);
53 
54 void tai_first_activities(struct ai_type *ait, struct player *pplayer);
55 void tai_phase_finished(struct ai_type *ait, struct player *pplayer);
Definition: ai.h:42
Definition: player.h:231
Definition: taimsg.h:31
struct player * plr
Definition: taimsg.h:33
enum taimsgtype type
Definition: taimsg.h:32
void * data
Definition: taimsg.h:34
Definition: taimsg.h:37
struct player * plr
Definition: taimsg.h:39
enum taireqtype type
Definition: taimsg.h:38
void * data
Definition: taimsg.h:40
void tai_send_req(enum taireqtype type, struct player *pplayer, void *data)
Construct and send request from player thread.
Definition: taimsg.c:45
void tai_send_msg(enum taimsgtype type, struct player *pplayer, void *data)
Construct and send message to player thread.
Definition: taimsg.c:24
void tai_phase_finished(struct ai_type *ait, struct player *pplayer)
Player phase has finished.
Definition: taimsg.c:67
void tai_first_activities(struct ai_type *ait, struct player *pplayer)
Time for phase first activities.
Definition: taimsg.c:59