Freeciv21
Develop your civilization from humble roots to a global empire
metaknowledge.cpp File Reference
#include "diptreaty.h"
#include "game.h"
#include "map.h"
#include "tile.h"
#include "traderoutes.h"
#include "metaknowledge.h"
+ Include dependency graph for metaknowledge.cpp:

Go to the source code of this file.

Functions

static bool is_tile_seen_cadj (const struct player *pow_player, const struct tile *target_tile)
 Returns TRUE iff the target_tile it self and all tiles cardinally adjacent to it are seen by pow_player. More...
 
static bool is_tile_seen_adj (const struct player *pow_player, const struct tile *target_tile)
 Returns TRUE iff the target_tile it self and all tiles adjacent to it are seen by pow_player. More...
 
static bool is_tile_seen_city (const struct player *pow_player, const struct city *target_city)
 Returns TRUE iff all tiles of a city are seen by pow_player. More...
 
static bool is_tile_seen_traderoute (const struct player *pow_player, const struct city *target_city)
 Returns TRUE iff all the tiles of a city and all the tiles of its trade partners are seen by pow_player. More...
 
static bool can_plr_see_all_sym_diplrels_of (const struct player *pplayer, const struct player *tplayer)
 Returns TRUE iff pplayer can see all the symmetric diplomatic relationships of tplayer. More...
 
static bool is_req_knowable (const struct player *pow_player, const struct player *target_player, const struct player *other_player, const struct city *target_city, const struct tile *target_tile, const struct unit *target_unit, const struct requirement *req, const enum req_problem_type prob_type)
 Is an evaluation of the requirement accurate when pow_player evaluates it? More...
 
enum fc_tristate mke_eval_req (const struct player *pow_player, const struct player *target_player, const struct player *other_player, const struct city *target_city, const struct impr_type *target_building, const struct tile *target_tile, const struct unit *target_unit, const struct output_type *target_output, const struct specialist *target_specialist, const struct requirement *req, const enum req_problem_type prob_type)
 Evaluate a single requirement given pow_player's knowledge. More...
 
enum fc_tristate mke_eval_reqs (const struct player *pow_player, const struct player *target_player, const struct player *other_player, const struct city *target_city, const struct impr_type *target_building, const struct tile *target_tile, const struct unit *target_unit, const struct output_type *target_output, const struct specialist *target_specialist, const struct requirement_vector *reqs, const enum req_problem_type prob_type)
 Evaluate a requirement vector given pow_player's knowledge. More...
 
bool can_see_techs_of_target (const struct player *pow_player, const struct player *target_player)
 Can pow_player see the techs of target player? More...
 

Function Documentation

◆ can_plr_see_all_sym_diplrels_of()

static bool can_plr_see_all_sym_diplrels_of ( const struct player pplayer,
const struct player tplayer 
)
static

Returns TRUE iff pplayer can see all the symmetric diplomatic relationships of tplayer.

Definition at line 130 of file metaknowledge.cpp.

Referenced by is_req_knowable().

◆ can_see_techs_of_target()

bool can_see_techs_of_target ( const struct player pow_player,
const struct player target_player 
)

Can pow_player see the techs of target player?

Definition at line 698 of file metaknowledge.cpp.

Referenced by choose_tech_to_steal(), and is_req_knowable().

◆ is_req_knowable()

static bool is_req_knowable ( const struct player pow_player,
const struct player target_player,
const struct player other_player,
const struct city target_city,
const struct tile target_tile,
const struct unit target_unit,
const struct requirement req,
const enum req_problem_type  prob_type 
)
static

Is an evaluation of the requirement accurate when pow_player evaluates it?

TODO: Move the data to a data file. That will

  • let non programmers help complete it and/or fix what is wrong
  • let clients not written in C use the data

Definition at line 159 of file metaknowledge.cpp.

◆ is_tile_seen_adj()

static bool is_tile_seen_adj ( const struct player pow_player,
const struct tile target_tile 
)
static

Returns TRUE iff the target_tile it self and all tiles adjacent to it are seen by pow_player.

Definition at line 50 of file metaknowledge.cpp.

Referenced by is_req_knowable().

◆ is_tile_seen_cadj()

static bool is_tile_seen_cadj ( const struct player pow_player,
const struct tile target_tile 
)
static

Returns TRUE iff the target_tile it self and all tiles cardinally adjacent to it are seen by pow_player.

Definition at line 25 of file metaknowledge.cpp.

Referenced by is_req_knowable().

◆ is_tile_seen_city()

static bool is_tile_seen_city ( const struct player pow_player,
const struct city target_city 
)
static

Returns TRUE iff all tiles of a city are seen by pow_player.

Definition at line 74 of file metaknowledge.cpp.

Referenced by is_req_knowable(), and is_tile_seen_traderoute().

◆ is_tile_seen_traderoute()

static bool is_tile_seen_traderoute ( const struct player pow_player,
const struct city target_city 
)
static

Returns TRUE iff all the tiles of a city and all the tiles of its trade partners are seen by pow_player.

Definition at line 100 of file metaknowledge.cpp.

Referenced by is_req_knowable().

◆ mke_eval_req()

enum fc_tristate mke_eval_req ( const struct player pow_player,
const struct player target_player,
const struct player other_player,
const struct city target_city,
const struct impr_type target_building,
const struct tile target_tile,
const struct unit target_unit,
const struct output_type target_output,
const struct specialist target_specialist,
const struct requirement req,
const enum req_problem_type  prob_type 
)

Evaluate a single requirement given pow_player's knowledge.

Note: Assumed to use pow_player's data.

Definition at line 159 of file metaknowledge.cpp.

◆ mke_eval_reqs()

enum fc_tristate mke_eval_reqs ( const struct player pow_player,
const struct player target_player,
const struct player other_player,
const struct city target_city,
const struct impr_type target_building,
const struct tile target_tile,
const struct unit target_unit,
const struct output_type target_output,
const struct specialist target_specialist,
const struct requirement_vector *  reqs,
const enum req_problem_type  prob_type 
)

Evaluate a requirement vector given pow_player's knowledge.

Note: Assumed to use pow_player's data.

Definition at line 159 of file metaknowledge.cpp.

Referenced by act_prob_unseen_target(), and action_maybe_possible_actor_unit().