Freeciv21
Develop your civilization from humble roots to a global empire
texaicity.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 /* ai/default */
16 #include "daicity.h"
17 
18 struct city;
19 struct texai_req;
20 
21 struct texai_city {
22  struct ai_city defai; // Keep this first so default ai finds it
24 };
25 
26 void texai_city_alloc(struct ai_type *ait, struct city *pcity);
27 void texai_city_free(struct ai_type *ait, struct city *pcity);
28 
30  struct player *pplayer,
31  struct city *pcity);
32 void texai_city_worker_wants(struct ai_type *ait, struct player *pplayer,
33  struct city *pcity);
34 void texai_req_worker_task_rcv(struct texai_req *req);
35 
36 static inline struct texai_city *texai_city_data(struct ai_type *ait,
37  const struct city *pcity)
38 {
39  return (struct texai_city *) city_ai_data(pcity, ait);
40 }
void * city_ai_data(const struct city *pcity, const struct ai_type *ai)
Return pointer to ai data of given city and ai type.
Definition: city.cpp:3509
Definition: ai.h:42
Definition: city.h:291
Definition: player.h:231
struct ai_city defai
Definition: texaicity.h:22
int unit_wants[U_LAST]
Definition: texaicity.h:23
void texai_city_alloc(struct ai_type *ait, struct city *pcity)
Initialize city for use with tex AI.
Definition: texaicity.c:584
void texai_city_free(struct ai_type *ait, struct city *pcity)
Free city from use with tex AI.
Definition: texaicity.c:598
void texai_city_worker_requests_create(struct ai_type *ait, struct player *pplayer, struct city *pcity)
Create worker request for the city.
Definition: texaicity.c:68
static struct texai_city * texai_city_data(struct ai_type *ait, const struct city *pcity)
Definition: texaicity.h:36
void texai_city_worker_wants(struct ai_type *ait, struct player *pplayer, struct city *pcity)
Set wants for worker-type units.
Definition: texaicity.c:91
void texai_req_worker_task_rcv(struct texai_req *req)
Receive message from thread to main thread.
Definition: texaicity.c:549
#define U_LAST
Definition: unittype.h:31