Freeciv21
Develop your civilization from humble roots to a global empire
texaimsg.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 texaimsgtype
16 #define SPECENUM_VALUE0 TEXAI_MSG_THR_EXIT
17 #define SPECENUM_VALUE0NAME "Exit"
18 #define SPECENUM_VALUE1 TEXAI_MSG_FIRST_ACTIVITIES
19 #define SPECENUM_VALUE1NAME "FirstActivities"
20 #define SPECENUM_VALUE2 TEXAI_MSG_PHASE_FINISHED
21 #define SPECENUM_VALUE2NAME "PhaseFinished"
22 #define SPECENUM_VALUE3 TEXAI_MSG_TILE_INFO
23 #define SPECENUM_VALUE3NAME "TileInfo"
24 #define SPECENUM_VALUE4 TEXAI_MSG_MAP_ALLOC
25 #define SPECENUM_VALUE4NAME "MapAlloc"
26 #define SPECENUM_VALUE5 TEXAI_MSG_MAP_FREE
27 #define SPECENUM_VALUE5NAME "MapFree"
28 #define SPECENUM_VALUE6 TEXAI_MSG_CITY_CREATED
29 #define SPECENUM_VALUE6NAME "CityCreated"
30 #define SPECENUM_VALUE7 TEXAI_MSG_CITY_CHANGED
31 #define SPECENUM_VALUE7NAME "CityChanged"
32 #define SPECENUM_VALUE8 TEXAI_MSG_CITY_DESTROYED
33 #define SPECENUM_VALUE8NAME "CityDestroyed"
34 #define SPECENUM_VALUE9 TEXAI_MSG_UNIT_CREATED
35 #define SPECENUM_VALUE9NAME "UnitCreated"
36 #define SPECENUM_VALUE10 TEXAI_MSG_UNIT_CHANGED
37 #define SPECENUM_VALUE10NAME "UnitChanged"
38 #define SPECENUM_VALUE11 TEXAI_MSG_UNIT_DESTROYED
39 #define SPECENUM_VALUE11NAME "UnitDestroyed"
40 #define SPECENUM_VALUE12 TEXAI_MSG_UNIT_MOVED
41 #define SPECENUM_VALUE12NAME "UnitMoved"
42 #include "specenum_gen.h"
43 
44 #define SPECENUM_NAME texaireqtype
45 #define SPECENUM_VALUE0 TEXAI_REQ_WORKER_TASK
46 #define SPECENUM_VALUE0NAME "WorkerTask"
47 #define SPECENUM_VALUE1 TEXAI_REQ_TURN_DONE
48 #define SPECENUM_VALUE1NAME "TurnDone"
49 #define SPECENUM_VALUE2 TEXAI_BUILD_CHOICE
50 #define SPECENUM_VALUE2NAME "BuildChoice"
51 #include "specenum_gen.h"
52 
53 struct texai_msg {
54  enum texaimsgtype type;
55  struct player *plr;
56  void *data;
57 };
58 
59 struct texai_req {
60  enum texaireqtype type;
61  struct player *plr;
62  void *data;
63 };
64 
65 #define SPECLIST_TAG texaimsg
66 #define SPECLIST_TYPE struct texai_msg
67 #include "speclist.h"
68 
69 #define SPECLIST_TAG texaireq
70 #define SPECLIST_TYPE struct texai_req
71 #include "speclist.h"
72 
73 void texai_send_msg(enum texaimsgtype type, struct player *pplayer,
74  void *data);
75 void texai_send_req(enum texaireqtype type, struct player *pplayer,
76  void *data);
77 
78 void texai_first_activities(struct ai_type *ait, struct player *pplayer);
79 void texai_phase_finished(struct ai_type *ait, struct player *pplayer);
Definition: ai.h:42
Definition: player.h:231
struct player * plr
Definition: texaimsg.h:55
enum texaimsgtype type
Definition: texaimsg.h:54
void * data
Definition: texaimsg.h:56
void * data
Definition: texaimsg.h:62
enum texaireqtype type
Definition: texaimsg.h:60
struct player * plr
Definition: texaimsg.h:61
void texai_first_activities(struct ai_type *ait, struct player *pplayer)
Time for phase first activities.
Definition: texaimsg.c:61
void texai_send_msg(enum texaimsgtype type, struct player *pplayer, void *data)
Construct and send message to player thread.
Definition: texaimsg.c:24
void texai_phase_finished(struct ai_type *ait, struct player *pplayer)
Player phase has finished.
Definition: texaimsg.c:69
void texai_send_req(enum texaireqtype type, struct player *pplayer, void *data)
Construct and send request from player thread.
Definition: texaimsg.c:46