Freeciv-3.3
Loading...
Searching...
No Matches
metaknowledge.c
Go to the documentation of this file.
1/***********************************************************************
2 Freeciv - Copyright (C) 1996-2013 - Freeciv Development Team
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/* common */
19#include "diptreaty.h"
20#include "game.h"
21#include "map.h"
22#include "metaknowledge.h"
23#include "tile.h"
24#include "traderoutes.h"
25
26/**********************************************************************/
30static bool is_tile_seen_cadj(const struct player *pow_player,
31 const struct tile *target_tile)
32{
33 /* The tile it self is unseen. */
35 return FALSE;
36 }
37
38 /* A cardinally adjacent tile is unseen. */
40 if (!tile_is_seen(ptile, pow_player)) {
41 return FALSE;
42 }
44
45 /* They are all seen. */
46 return TRUE;
47}
48
49/**********************************************************************/
53static bool is_tile_seen_adj(const struct player *pow_player,
54 const struct tile *target_tile)
55{
56 /* The tile it self is unseen. */
58 return FALSE;
59 }
60
61 /* An adjacent tile is unseen. */
62 adjc_iterate(&(wld.map), target_tile, ptile) {
63 if (!tile_is_seen(ptile, pow_player)) {
64 return FALSE;
65 }
67
68 /* They are all seen. */
69 return TRUE;
70}
71
72/**********************************************************************/
75static bool is_tile_seen_city(const struct player *pow_player,
76 const struct city *target_city)
77{
78 const struct civ_map *nmap = &(wld.map);
79
80 /* Don't know the city radius. */
82 return FALSE;
83 }
84
85 /* A tile of the city is unseen */
87 city_tile(target_city), ptile) {
88 if (!tile_is_seen(ptile, pow_player)) {
89 return FALSE;
90 }
92
93 /* They are all seen. */
94 return TRUE;
95}
96
97/**********************************************************************/
102 const struct city *target_city)
103{
104 /* Don't know who the trade routes will go to. */
106 return FALSE;
107 }
108
109 /* A tile of the city is unseen */
111 return FALSE;
112 }
113
114 /* A tile of a trade parter is unseen */
117 return FALSE;
118 }
120
121 /* They are all seen. */
122 return TRUE;
123}
124
125/**********************************************************************/
129static bool can_plr_see_all_sym_diplrels_of(const struct player *pplayer,
130 const struct player *tplayer)
131{
132 if (pplayer == tplayer) {
133 /* Can see own relationships. */
134 return TRUE;
135 }
136
137 if (team_has_embassy(pplayer->team, tplayer)) {
138 /* Gets reports from the embassy. */
139 return TRUE;
140 }
141
142 if (player_diplstate_get(pplayer, tplayer)->contact_turns_left > 0) {
143 /* Can see relationships during contact turns. */
144 return TRUE;
145 }
146
147 return FALSE;
148}
149
150/**********************************************************************/
161static bool is_req_knowable(const struct player *pov_player,
162 const struct req_context *context,
163 const struct req_context *other_context,
164 const struct requirement *req,
165 const enum req_problem_type prob_type)
166{
167 fc_assert_ret_val_msg(NULL != pov_player, FALSE, "No point of view");
168
169 if (context == NULL) {
171 }
172 if (other_context == NULL) {
174 }
175
176 if (req->source.kind == VUT_UTFLAG
177 || req->source.kind == VUT_UTYPE
178 || req->source.kind == VUT_UCLASS
179 || req->source.kind == VUT_UCFLAG
180 || req->source.kind == VUT_MINVETERAN
181 || req->source.kind == VUT_MINHP) {
182 switch (req->range) {
183 case REQ_RANGE_LOCAL:
184 if (context->unit == NULL) {
185 /* The unit may exist but not be passed when the problem type is
186 * RPT_POSSIBLE. */
187 return prob_type == RPT_CERTAIN;
188 }
189
191 case REQ_RANGE_TILE:
195 case REQ_RANGE_CITY:
197 case REQ_RANGE_PLAYER:
198 case REQ_RANGE_TEAM:
200 case REQ_RANGE_WORLD:
201 case REQ_RANGE_COUNT:
202 return FALSE;
203 }
204 }
205
206 if (req->source.kind == VUT_UNITSTATE) {
207 fc_assert_ret_val_msg(req->range == REQ_RANGE_LOCAL, FALSE, "Wrong range");
208
209 if (context->unit == NULL) {
210 /* The unit may exist but not be passed when the problem type is
211 * RPT_POSSIBLE. */
212 return prob_type == RPT_CERTAIN;
213 }
214
215 switch (req->source.value.unit_state) {
216 case USP_TRANSPORTED:
217 case USP_LIVABLE_TILE:
218 case USP_TRANSPORTING:
219 case USP_NATIVE_TILE:
220 case USP_NATIVE_EXTRA:
221 /* Known if the unit is seen by the player. */
225 /* Known to the unit's owner. */
226 return unit_owner(context->unit) == pov_player;
227 case USP_COUNT:
229 "Invalid unit state property.");
230 /* Invalid property is unknowable. */
231 return FALSE;
232 }
233 }
234
235 if (req->source.kind == VUT_MINMOVES) {
236 fc_assert_ret_val_msg(req->range == REQ_RANGE_LOCAL, FALSE, "Wrong range");
237
238 if (context->unit == NULL) {
239 /* The unit may exist but not be passed when the problem type is
240 * RPT_POSSIBLE. */
241 return prob_type == RPT_CERTAIN;
242 }
243
244 switch (req->range) {
245 case REQ_RANGE_LOCAL:
246 /* The owner can see if their unit has move fragments left. */
247 return unit_owner(context->unit) == pov_player;
248 case REQ_RANGE_TILE:
251 case REQ_RANGE_CITY:
254 case REQ_RANGE_PLAYER:
255 case REQ_RANGE_TEAM:
257 case REQ_RANGE_WORLD:
258 case REQ_RANGE_COUNT:
259 /* Invalid range */
260 return FALSE;
261 }
262 }
263
264 if (req->source.kind == VUT_ACTIVITY) {
266 FALSE, "Wrong range");
267
268 if (context->unit == NULL) {
269 /* The unit may exist but not be passed when the problem type is
270 * RPT_POSSIBLE. */
271 return prob_type == RPT_CERTAIN;
272 }
273
274 if (unit_owner(context->unit) == pov_player) {
275 return TRUE;
276 }
277
278 /* Sent in package_short_unit() */
280 }
281
282 if (req->source.kind == VUT_DIPLREL
283 || req->source.kind == VUT_DIPLREL_TILE
286 || req->source.kind == VUT_DIPLREL_UNITANY_O) {
287 switch (req->range) {
288 case REQ_RANGE_LOCAL:
289 if (other_context->player == NULL
290 || context->player == NULL) {
291 /* The two players may exist but not be passed when the problem
292 * type is RPT_POSSIBLE. */
293 return prob_type == RPT_CERTAIN;
294 }
295
296 if (pov_player == context->player
297 || pov_player == other_context->player) {
298 return TRUE;
299 }
300
303 other_context->player)) {
304 return TRUE;
305 }
306
307 /* TODO: Non symmetric diplomatic relationships. */
308 break;
309 case REQ_RANGE_PLAYER:
310 if (context->player == NULL) {
311 /* The target player may exist but not be passed when the problem
312 * type is RPT_POSSIBLE. */
313 return prob_type == RPT_CERTAIN;
314 }
315
316 if (pov_player == context->player) {
317 return TRUE;
318 }
319
321 return TRUE;
322 }
323
324 /* TODO: Non symmetric diplomatic relationships. */
325 break;
326 case REQ_RANGE_TEAM:
327 /* TODO */
328 break;
330 /* TODO */
331 break;
332 case REQ_RANGE_WORLD:
333 /* TODO */
334 break;
335 case REQ_RANGE_TILE:
338 case REQ_RANGE_CITY:
341 case REQ_RANGE_COUNT:
342 /* Invalid range */
343 return FALSE;
344 break;
345 }
346 }
347
348 if (req->source.kind == VUT_MINSIZE) {
349 if (context->city == NULL) {
350 /* The city may exist but not be passed when the problem type is
351 * RPT_POSSIBLE. */
352 return prob_type == RPT_CERTAIN;
353 }
354
356 return TRUE;
357 }
358 }
359
360 if (req->source.kind == VUT_CITYTILE) {
361 struct city *pcity;
362
363 if (context->city == NULL) {
364 switch (req->source.value.citytile) {
365 case CITYT_CENTER:
368 /* Require the city, not passed */
369 return prob_type == RPT_CERTAIN;
370 case CITYT_CLAIMED:
371 case CITYT_WORKED:
373 /* Do not require a city passed */
374 break;
375 case CITYT_LAST:
376 /* Invalid */
378 "Invalid city tile property.");
379 return FALSE;
380 }
381 }
382
383 if (context->tile == NULL) {
384 /* The tile may exist but not be passed when the problem type is
385 * RPT_POSSIBLE. */
386 return prob_type == RPT_CERTAIN;
387 }
388
389 switch (req->range) {
390 case REQ_RANGE_TILE:
391 /* Known because the tile is seen */
392 if (tile_is_seen(context->tile, pov_player)) {
393 return TRUE;
394 }
395
396 /* The player knows their city even if they can't see it */
397 pcity = tile_city(context->tile);
398 return pcity && city_owner(pcity) == pov_player;
400 /* Known because the tile is seen */
402 return TRUE;
403 }
404
405 /* The player knows their city even if they can't see it */
406 cardinal_adjc_iterate(&(wld.map), context->tile, ptile) {
407 pcity = tile_city(ptile);
408 if (pcity && city_owner(pcity) == pov_player) {
409 return TRUE;
410 }
412
413 /* Unknown */
414 return FALSE;
416 /* Known because the tile is seen */
417 if (is_tile_seen_adj(pov_player, context->tile)) {
418 return TRUE;
419 }
420
421 /* The player knows their city even if they can't see it */
422 adjc_iterate(&(wld.map), context->tile, ptile) {
423 pcity = tile_city(ptile);
424 if (pcity && city_owner(pcity) == pov_player) {
425 return TRUE;
426 }
428
429 /* Unknown */
430 return FALSE;
431 case REQ_RANGE_CITY:
434 case REQ_RANGE_PLAYER:
435 case REQ_RANGE_TEAM:
437 case REQ_RANGE_WORLD:
438 case REQ_RANGE_LOCAL:
439 case REQ_RANGE_COUNT:
440 /* Invalid range */
441 return FALSE;
442 }
443 }
444
445 if (req->source.kind == VUT_IMPR_GENUS) {
446 /* The only legal range when this was written was local. */
448
449 if (context->city == NULL) {
450 /* RPT_CERTAIN: Can't be. No city to contain it.
451 * RPT_POSSIBLE: A city like that may exist but not be passed. */
452 return prob_type == RPT_CERTAIN;
453 }
454
455 /* Local BuildingGenus could be about city production. */
457 }
458
459 if (req->source.kind == VUT_IMPROVEMENT) {
460 switch (req->range) {
461 case REQ_RANGE_WORLD:
463 case REQ_RANGE_TEAM:
464 case REQ_RANGE_PLAYER:
466 /* Only wonders (great or small) can be required in those ranges.
467 * Wonders are always visible. */
468 return TRUE;
470 /* Could be known for trade routes to cities owned by pov_player as
471 * long as the requirement is present. Not present requirements would
472 * require knowledge that no trade routes to another foreign city
473 * exists (since all possible trade routes are to a city owned by
474 * pov_player). Not worth the complexity, IMHO. */
475 return FALSE;
476 case REQ_RANGE_CITY:
477 case REQ_RANGE_LOCAL:
478 if (context->city == NULL) {
479 /* RPT_CERTAIN: Can't be. No city to contain it.
480 * RPT_POSSIBLE: A city like that may exist but not be passed. */
481 return prob_type == RPT_CERTAIN;
482 }
483
485 /* Anyone that can see city internals (like the owner) known all
486 * its improvements. */
487 return TRUE;
488 }
489
492 /* Can see visible improvements when the outside of the city is
493 * seen. */
494 return TRUE;
495 }
496
497 /* No way to know if a city has an improvement */
498 return FALSE;
499 case REQ_RANGE_TILE:
500 if (context->tile == NULL) {
501 /* RPT_CERTAIN: Can't be. No tile to contain it.
502 * RPT_POSSIBLE: A tile city like that may exist but not be passed. */
503 return prob_type == RPT_CERTAIN;
504 }
505
506 {
507 const struct city *tcity = tile_city(context->tile);
508
509 if (!tcity) {
510 /* No building can be in no city if it's known
511 * there is no city */
513 const struct city *wcity
515
516 if (!wcity
518 /* Player can be sure the wonder is not here */
519 return TRUE;
520 /* FIXME: deducing from known borders aside, the player
521 * may have seen wcity before and cities don't move */
522 }
523 }
524
525 return tile_is_seen(context->tile, pov_player);
526 }
527
529 /* Anyone that can see city internals (like the owner) known all
530 * its improvements. */
531 return TRUE;
532 }
533
536 /* Can see visible improvements when the outside of the city is
537 * seen. */
538 return TRUE;
539 }
540 }
541
542 /* No way to know if a city has an improvement */
543 return FALSE;
546 case REQ_RANGE_COUNT:
547 /* Not supported by the requirement type. */
548 return FALSE;
549 }
550 }
551
552 if (req->source.kind == VUT_NATION
553 || req->source.kind == VUT_NATIONGROUP) {
554 if (context->player == NULL
555 && (req->range == REQ_RANGE_PLAYER
556 || req->range == REQ_RANGE_TEAM
557 || req->range == REQ_RANGE_ALLIANCE)) {
558 /* The player (that can have a nationality or be allied to someone
559 * with the nationality) may exist but not be passed when the problem
560 * type is RPT_POSSIBLE. */
561 return prob_type == RPT_CERTAIN;
562 }
563
564 return TRUE;
565 }
566
567 if (req->source.kind == VUT_ADVANCE || req->source.kind == VUT_TECHFLAG) {
568 if (req->range == REQ_RANGE_PLAYER) {
569 if (context->player == NULL) {
570 /* The player (that may or may not possess the tech) may exist but
571 * not be passed when the problem type is RPT_POSSIBLE. */
572 return prob_type == RPT_CERTAIN;
573 }
574
576 } else if (req->range == REQ_RANGE_WORLD && req->survives) {
577 /* game.info.global_advances is sent to each player */
578 return TRUE;
579 }
580 }
581
582 if (req->source.kind == VUT_GOVERNMENT) {
583 if (req->range == REQ_RANGE_PLAYER) {
584 if (context->player == NULL) {
585 /* The player (that may or may not possess the tech) may exist but
586 * not be passed when the problem type is RPT_POSSIBLE. */
587 return prob_type == RPT_CERTAIN;
588 }
589
590 return (pov_player == context->player
592 }
593 }
594
595 if (req->source.kind == VUT_MAXTILEUNITS) {
596 if (context->tile == NULL) {
597 /* The tile may exist but not be passed when the problem type is
598 * RPT_POSSIBLE. */
599 return prob_type == RPT_CERTAIN;
600 }
601
602 switch (req->range) {
603 case REQ_RANGE_TILE:
607 return FALSE;
608 }
611 return FALSE;
612 }
614
615 return TRUE;
618 return FALSE;
619 }
620 adjc_iterate(&(wld.map), context->tile, adjc_tile) {
622 return FALSE;
623 }
625
626 return TRUE;
628 case REQ_RANGE_CITY:
630 case REQ_RANGE_PLAYER:
631 case REQ_RANGE_TEAM:
633 case REQ_RANGE_WORLD:
634 case REQ_RANGE_LOCAL:
635 case REQ_RANGE_COUNT:
636 /* Non existing. */
637 return FALSE;
638 }
639 }
640
641 if (req->source.kind == VUT_EXTRA
642 || req->source.kind == VUT_EXTRAFLAG
643 || req->source.kind == VUT_ROADFLAG) {
644 if (req->range == REQ_RANGE_LOCAL) {
645 if (context->extra == NULL) {
646 /* The extra may exist but not be passed when the problem type is
647 * RPT_POSSIBLE. */
648 return prob_type == RPT_CERTAIN;
649 }
650 /* The extra is given; we can figure out whether it matches. */
651 return TRUE;
652 }
653 /* Other ranges handled below */
654 }
655
656 if (req->source.kind == VUT_TERRAIN
657 || req->source.kind == VUT_TERRFLAG
658 || req->source.kind == VUT_TERRAINCLASS
659 || req->source.kind == VUT_TERRAINALTER
660 || req->source.kind == VUT_EXTRA
661 || req->source.kind == VUT_EXTRAFLAG
662 || req->source.kind == VUT_ROADFLAG) {
663 if (context->tile == NULL) {
664 /* The tile may exist but not be passed when the problem type is
665 * RPT_POSSIBLE. */
666 return prob_type == RPT_CERTAIN;
667 }
668
669 switch (req->range) {
670 case REQ_RANGE_TILE:
671 return tile_is_seen(context->tile, pov_player);
673 /* TODO: The answer is known when the universal is located on a seen
674 * tile. Is returning TRUE in those cases worth the added complexity
675 * and the extra work for the computer? */
676 return is_tile_seen_cadj(pov_player, context->tile);
678 /* TODO: The answer is known when the universal is located on a seen
679 * tile. Is returning TRUE in those cases worth the added complexity
680 * and the extra work for the computer? */
681 return is_tile_seen_adj(pov_player, context->tile);
682 case REQ_RANGE_CITY:
683 /* TODO: The answer is known when the universal is located on a seen
684 * tile. Is returning TRUE in those cases worth the added complexity
685 * and the extra work for the computer? */
686 return is_tile_seen_city(pov_player, context->city);
688 /* TODO: The answer is known when the universal is located on a seen
689 * tile. Is returning TRUE in those cases worth the added complexity
690 * and the extra work for the computer? */
693 case REQ_RANGE_PLAYER:
695 case REQ_RANGE_TEAM:
696 case REQ_RANGE_WORLD:
697 case REQ_RANGE_LOCAL:
698 case REQ_RANGE_COUNT:
699 /* Non existing range for requirement types. */
700 return FALSE;
701 }
702 }
703
704 if (req->source.kind == VUT_MAX_DISTANCE_SQ) {
705 if (context->tile == nullptr || other_context->tile == nullptr) {
706 /* The tiles may exist but not be passed when the problem type is
707 * RPT_POSSIBLE. */
708 return prob_type == RPT_CERTAIN;
709 }
710 /* Tile locations and their distance are fixed */
711 return TRUE;
712 }
713
714 if (req->source.kind == VUT_MAX_REGION_TILES) {
715 if (context->tile == NULL) {
716 /* The tile may exist but not be passed when the problem type is
717 * RPT_POSSIBLE. */
718 return prob_type == RPT_CERTAIN;
719 }
720
721 switch (req->range) {
724 /* TODO: Known tiles might be enough to determine the answer already;
725 * should we check on an individual requirement basis? */
727 return FALSE;
728 }
729 range_adjc_iterate(&(wld.map), context->tile, req->range, adj_tile) {
731 return FALSE;
732 }
734 return TRUE;
736 /* Too complicated to figure out */
737 return FALSE;
738 case REQ_RANGE_CITY:
740 case REQ_RANGE_PLAYER:
742 case REQ_RANGE_TEAM:
743 case REQ_RANGE_WORLD:
744 case REQ_RANGE_LOCAL:
745 case REQ_RANGE_TILE:
746 case REQ_RANGE_COUNT:
747 /* Non existing range for requirement types. */
748 return FALSE;
749 }
750 }
751
752 if (req->source.kind == VUT_TILE_REL) {
753 enum known_type needed;
754 if (context->tile == NULL || other_context->tile == NULL) {
755 /* The tile may exist but not be passed when the problem type is
756 * RPT_POSSIBLE. */
757 return prob_type == RPT_CERTAIN;
758 }
759 switch (req->source.value.tilerel) {
761 /* Too complicated to figure out */
762 return FALSE;
763 case TREL_SAME_TCLASS:
764 /* Evaluated based on actual terrain type's class */
765 needed = TILE_KNOWN_SEEN;
766 break;
767 default:
768 /* Only need the continent ID; known is enough */
769 needed = TILE_KNOWN_UNSEEN;
770 break;
771 }
772 if (tile_get_known(other_context->tile, pov_player) < needed) {
773 return FALSE;
774 }
775
776 switch (req->range) {
777 case REQ_RANGE_TILE:
780 /* TODO: Known tiles might be enough to determine the answer already;
781 * should we check on an individual requirement basis? */
782 if (tile_get_known(context->tile, pov_player) < needed) {
783 return FALSE;
784 }
785 range_adjc_iterate(&(wld.map), context->tile, req->range, adj_tile) {
786 if (tile_get_known(adj_tile, pov_player) < needed) {
787 return FALSE;
788 }
790 return TRUE;
791 case REQ_RANGE_CITY:
794 case REQ_RANGE_PLAYER:
796 case REQ_RANGE_TEAM:
797 case REQ_RANGE_WORLD:
798 case REQ_RANGE_LOCAL:
799 case REQ_RANGE_COUNT:
800 /* Non existing range for requirement types. */
801 return FALSE;
802 }
803 }
804
805 if (req->source.kind == VUT_ACTION
806 || req->source.kind == VUT_OTYPE) {
807 /* This requirement type is intended to specify the situation. */
808 return TRUE;
809 }
810
811 if (req->source.kind == VUT_SERVERSETTING) {
812 /* Only visible server settings can be requirements. */
813 return TRUE;
814 }
815
816 /* Uncertain or no support added yet. */
817 return FALSE;
818}
819
820/**********************************************************************/
828enum fc_tristate
830 const struct req_context *context,
831 const struct req_context *other_context,
832 const struct requirement *req,
833 const enum req_problem_type prob_type)
834{
836 req, prob_type)) {
837 return TRI_MAYBE;
838 }
839
841 return TRI_YES;
842 } else {
843 return TRI_NO;
844 }
845}
846
847/**********************************************************************/
855enum fc_tristate
857 const struct req_context *context,
858 const struct req_context *other_context,
859 const struct requirement_vector *reqs,
860 const enum req_problem_type prob_type)
861{
862 enum fc_tristate current;
863 enum fc_tristate result;
864
865 result = TRI_YES;
868 preq, prob_type);
869 if (current == TRI_NO) {
870 return TRI_NO;
871 } else if (current == TRI_MAYBE) {
872 result = TRI_MAYBE;
873 }
875
876 return result;
877}
878
879/**********************************************************************/
883 const struct player *target_player)
884{
885 return pow_player == target_player
887}
int city_map_radius_sq_get(const struct city *pcity)
Definition city.c:137
#define city_tile(_pcity_)
Definition city.h:561
#define city_owner(_pcity_)
Definition city.h:560
#define city_tile_iterate(_nmap, _radius_sq, _city_tile, _tile)
Definition city.h:227
#define city_tile_iterate_end
Definition city.h:235
char * incite_cost
Definition comments.c:76
struct unit struct city struct unit struct tile * target_tile
Definition dialogs_g.h:57
struct unit struct city struct unit struct tile struct extra_type const struct act_prob *act_probs int actor_unit_id struct unit struct unit int const struct action *paction struct unit struct city * pcity
Definition dialogs_g.h:78
struct unit struct city * target_city
Definition dialogs_g.h:56
bool could_intel_with_player(const struct player *pplayer, const struct player *aplayer)
Definition diptreaty.c:84
struct @22::@23 reqs
req_problem_type
Definition fc_types.h:531
@ RPT_CERTAIN
Definition fc_types.h:533
struct world wld
Definition game.c:62
bool is_improvement_visible(const struct impr_type *pimprove)
bool is_great_wonder(const struct impr_type *pimprove)
struct city * city_from_great_wonder(const struct impr_type *pimprove)
#define fc_assert_msg(condition, message,...)
Definition log.h:182
#define fc_assert(condition)
Definition log.h:177
#define fc_assert_ret_val_msg(condition, val, message,...)
Definition log.h:209
#define range_adjc_iterate(nmap, center_tile, range, itr_tile)
Definition map.h:498
#define adjc_iterate_end
Definition map.h:430
#define range_adjc_iterate_end
Definition map.h:501
#define cardinal_adjc_iterate_end
Definition map.h:456
#define adjc_iterate(nmap, center_tile, itr_tile)
Definition map.h:425
#define cardinal_adjc_iterate(nmap, center_tile, itr_tile)
Definition map.h:452
static bool is_tile_seen_cadj(const struct player *pow_player, const struct tile *target_tile)
bool can_see_techs_of_target(const struct player *pow_player, const struct player *target_player)
static bool is_tile_seen_city(const struct player *pow_player, const struct city *target_city)
static bool can_plr_see_all_sym_diplrels_of(const struct player *pplayer, const struct player *tplayer)
static bool is_tile_seen_trade_route(const struct player *pow_player, const struct city *target_city)
static bool is_req_knowable(const struct player *pov_player, const struct req_context *context, const struct req_context *other_context, const struct requirement *req, const enum req_problem_type prob_type)
enum fc_tristate mke_eval_req(const struct player *pov_player, const struct req_context *context, const struct req_context *other_context, const struct requirement *req, const enum req_problem_type prob_type)
static bool is_tile_seen_adj(const struct player *pow_player, const struct tile *target_tile)
enum fc_tristate mke_eval_reqs(const struct player *pov_player, const struct req_context *context, const struct req_context *other_context, const struct requirement_vector *reqs, const enum req_problem_type prob_type)
bool can_player_see_unit(const struct player *pplayer, const struct unit *punit)
Definition player.c:1104
bool team_has_embassy(const struct team *pteam, const struct player *tgt_player)
Definition player.c:220
bool player_can_see_city_externals(const struct player *pow_player, const struct city *target_city)
Definition player.c:1164
struct player_diplstate * player_diplstate_get(const struct player *plr1, const struct player *plr2)
Definition player.c:324
bool can_player_see_hypotetic_units_at(const struct player *pplayer, const struct tile *ptile)
Definition player.c:993
bool can_player_see_city_internals(const struct player *pplayer, const struct city *pcity)
Definition player.c:1149
const struct req_context * req_context_empty(void)
bool is_req_active(const struct req_context *context, const struct req_context *other_context, const struct requirement *req, const enum req_problem_type prob_type)
#define requirement_vector_iterate_end
#define requirement_vector_iterate(req_vec, preq)
fc_tristate
Definition shared.h:46
@ TRI_YES
Definition shared.h:46
@ TRI_NO
Definition shared.h:46
@ TRI_MAYBE
Definition shared.h:46
Definition city.h:317
struct team * team
Definition player.h:261
enum req_range range
struct universal source
Definition tile.h:50
enum universals_n kind
Definition fc_types.h:608
universals_u value
Definition fc_types.h:607
struct civ_map map
#define TRUE
Definition support.h:46
#define FALSE
Definition support.h:47
bool tile_is_seen(const struct tile *target_tile, const struct player *pow_player)
Definition tile.c:407
enum known_type tile_get_known(const struct tile *ptile, const struct player *pplayer)
Definition tile.c:392
struct city * tile_city(const struct tile *ptile)
Definition tile.c:83
known_type
Definition tile.h:35
@ TILE_KNOWN_UNSEEN
Definition tile.h:37
@ TILE_UNKNOWN
Definition tile.h:36
@ TILE_KNOWN_SEEN
Definition tile.h:38
#define trade_partners_iterate_end
#define trade_partners_iterate(c, p)
enum citytile_type citytile
Definition fc_types.h:562
enum tilerel_type tilerel
Definition fc_types.h:565
const struct impr_type * building
Definition fc_types.h:546
enum ustate_prop unit_state
Definition fc_types.h:582
#define unit_owner(_pu)
Definition unit.h:403