Freeciv-3.3: /fast/freeciv/nightly/main/common/traderoutes.h File Reference

Freeciv-3.3

Loading...
Searching...
No Matches
Data Structures | Macros | Enumerations | Functions
traderoutes.h File Reference
`#include "support.h"`
`#include "specenum_gen.h"`
`#include "speclist.h"`

Go to the source code of this file.

## Data Structures

struct | trade_route_settings
struct | trade_route
struct | goods_type

## Macros

#define | SPECENUM_NAME trade_route_bonus_type
#define | SPECENUM_VALUE0 TBONUS_NONE
#define | SPECENUM_VALUE0NAME "None"
#define | SPECENUM_VALUE1 TBONUS_GOLD
#define | SPECENUM_VALUE1NAME "Gold"
#define | SPECENUM_VALUE2 TBONUS_SCIENCE
#define | SPECENUM_VALUE2NAME "Science"
#define | SPECENUM_VALUE3 TBONUS_BOTH
#define | SPECENUM_VALUE3NAME "Both"
#define | SPECENUM_NAME route_direction
#define | SPECENUM_VALUE0 RDIR_NONE
#define | SPECENUM_VALUE0NAME N_("?routedir:None")
#define | SPECENUM_VALUE1 RDIR_FROM
#define | SPECENUM_VALUE1NAME N_("?routedir:From")
#define | SPECENUM_VALUE2 RDIR_TO
#define | SPECENUM_VALUE2NAME N_("?routedir:To")
#define | SPECENUM_VALUE3 RDIR_BIDIRECTIONAL
#define | SPECENUM_VALUE3NAME N_("?routedir:Bidirectional")
#define | SPECLIST_TAG trade_route
#define | SPECLIST_TYPE struct trade_route
#define | trade_route_list_iterate(trade_route_list, proute) TYPED_LIST_ITERATE(struct trade_route, trade_route_list, proute)
#define | trade_route_list_iterate_end LIST_ITERATE_END
#define | trade_routes_iterate(c, proute)
#define | trade_routes_iterate_end
#define | trade_routes_iterate_safe(c, proute)
#define | trade_routes_iterate_safe_end
#define | trade_partners_iterate(c, p)
#define | trade_partners_iterate_end
#define | SPECENUM_NAME goods_flag_id
#define | SPECENUM_VALUE0 GF_BIDIRECTIONAL
#define | SPECENUM_VALUE0NAME "Bidirectional"
#define | SPECENUM_VALUE1 GF_DEPLETES
#define | SPECENUM_VALUE1NAME "Depletes"
#define | SPECENUM_VALUE2 GF_SELF_PROVIDED
#define | SPECENUM_VALUE2NAME "Self-Provided"
#define | SPECENUM_COUNT GF_COUNT
#define | SPECENUM_BITVECTOR bv_goods_flags
#define | GOODS_HIGH_PRIORITY 100
#define | goods_type_iterate(_p)
#define | goods_type_iterate_end
#define | goods_type_re_active_iterate(_p)
#define | goods_type_re_active_iterate_end

## Enumerations

enum | trade_route_illegal_cancelling { TRI_ACTIVE = 0 , TRI_INACTIVE = 1 , TRI_CANCEL = 2 , TRI_LAST = 3 }
enum | trade_route_type { TRT_NATIONAL = 0 , TRT_NATIONAL_IC = 1 , TRT_IN = 2 , TRT_IN_IC = 3 , TRT_ALLY = 4 , TRT_ALLY_IC = 5 , TRT_ENEMY = 6 , TRT_ENEMY_IC = 7 , TRT_TEAM = 8 , TRT_TEAM_IC = 9 , TRT_LAST = 10 }

## Functions

unsigned | max_trade_routes (const struct city *pcity)
enum trade_route_type | cities_trade_route_type (const struct city *pcity1, const struct city *pcity2)
int | trade_route_type_trade_pct (enum trade_route_type type)
void | trade_route_types_init (void)
const char * | trade_route_type_name (enum trade_route_type type)
enum trade_route_type | trade_route_type_by_name (const char *name)
const char * | trade_route_cancelling_type_name (enum trade_route_illegal_cancelling type)
enum trade_route_illegal_cancelling | trade_route_cancelling_type_by_name (const char *name)
struct trade_route_settings * | trade_route_settings_by_type (enum trade_route_type type)
bool | can_cities_trade (const struct city *pc1, const struct city *pc2)
bool | can_establish_trade_route (const struct city *pc1, const struct city *pc2, int priority)
bool | have_cities_trade_route (const struct city *pc1, const struct city *pc2)
int | trade_base_between_cities (const struct city *pc1, const struct city *pc2)
int | trade_from_route (const struct city *pc1, const struct trade_route *route, int base)
int | city_num_trade_routes (const struct city *pcity)
int | max_trade_prod (const struct city *pcity)
int | get_caravan_enter_city_trade_bonus (const struct city *pc1, const struct city *pc2, const struct unit_type *ut, struct goods_type *pgood, const bool establish_trade)
int | city_trade_removable (const struct city *pcity, int priority, struct trade_route_list *would_remove)
void | goods_init (void)
void | goods_free (void)
Goods_type_id | goods_index (const struct goods_type *pgood)
Goods_type_id | goods_number (const struct goods_type *pgood)
struct goods_type * | goods_by_number (Goods_type_id id)
const char * | goods_name_translation (struct goods_type *pgood)
const char * | goods_rule_name (struct goods_type *pgood)
struct goods_type * | goods_by_rule_name (const char *name)
struct goods_type * | goods_by_translated_name (const char *name)
bool | goods_has_flag (const struct goods_type *pgood, enum goods_flag_id flag)
bool | goods_can_be_provided (const struct city *pcity, const struct goods_type *pgood, const struct unit *punit)
struct goods_type * | goods_from_city_to_unit (const struct city *src, const struct unit *punit)
struct goods_type * | unit_current_goods (const struct unit *punit, const struct city *homecity)
bool | city_receives_goods (const struct city *pcity, const struct goods_type *pgood)

## Macro Definition Documentation

## ◆ GOODS_HIGH_PRIORITY

#define GOODS_HIGH_PRIORITY 100

Definition at line 184 of file traderoutes.h.

## ◆ goods_type_iterate

#define goods_type_iterate | ( |  | _p | ) |

Value:
{ \
int _i_; \
for (_i_ = 0; _i_ < game.control.num_goods_types ; _i_++) { \
struct goods_type *_p = goods_by_number(_i_);
incite_cost
char * incite_cost
Definition comments.c:74
game
struct civ_game game
Definition game.c:61
civ_game::control
struct packet_ruleset_control control
Definition game.h:83
goods_type
Definition traderoutes.h:187
packet_ruleset_control::num_goods_types
int num_goods_types
Definition packets_gen.h:1446
goods_by_number
struct goods_type * goods_by_number(Goods_type_id id)
Definition traderoutes.c:620

Definition at line 231 of file traderoutes.h.

## ◆ goods_type_iterate_end

#define goods_type_iterate_end

Value:
} \
}

Definition at line 237 of file traderoutes.h.

## ◆ goods_type_re_active_iterate

#define goods_type_re_active_iterate | ( |  | _p | ) |

Value:
goods_type_iterate(_p) { \
if (!_p->ruledit_disabled) {
goods_type_iterate
#define goods_type_iterate(_p)
Definition traderoutes.h:231

Definition at line 241 of file traderoutes.h.

## ◆ goods_type_re_active_iterate_end

#define goods_type_re_active_iterate_end

Value:
} \
} goods_type_iterate_end;
goods_type_iterate_end
#define goods_type_iterate_end
Definition traderoutes.h:237

Definition at line 245 of file traderoutes.h.

## ◆ SPECENUM_BITVECTOR

#define SPECENUM_BITVECTOR bv_goods_flags

Definition at line 180 of file traderoutes.h.

## ◆ SPECENUM_COUNT

#define SPECENUM_COUNT GF_COUNT

Definition at line 179 of file traderoutes.h.

## ◆ SPECENUM_NAME [1/3]

#define SPECENUM_NAME trade_route_bonus_type

Definition at line 52 of file traderoutes.h.

## ◆ SPECENUM_NAME [2/3]

#define SPECENUM_NAME route_direction

Definition at line 52 of file traderoutes.h.

## ◆ SPECENUM_NAME [3/3]

#define SPECENUM_NAME goods_flag_id

Definition at line 52 of file traderoutes.h.

## ◆ SPECENUM_VALUE0 [1/3]

#define SPECENUM_VALUE0 TBONUS_NONE

Definition at line 53 of file traderoutes.h.

## ◆ SPECENUM_VALUE0 [2/3]

#define SPECENUM_VALUE0 RDIR_NONE

Definition at line 53 of file traderoutes.h.

## ◆ SPECENUM_VALUE0 [3/3]

#define SPECENUM_VALUE0 GF_BIDIRECTIONAL

Definition at line 53 of file traderoutes.h.

## ◆ SPECENUM_VALUE0NAME [1/3]

#define SPECENUM_VALUE0NAME "None"

Definition at line 54 of file traderoutes.h.

## ◆ SPECENUM_VALUE0NAME [2/3]

#define SPECENUM_VALUE0NAME N_("?routedir:None")

Definition at line 54 of file traderoutes.h.

## ◆ SPECENUM_VALUE0NAME [3/3]

#define SPECENUM_VALUE0NAME "Bidirectional"

Definition at line 54 of file traderoutes.h.

## ◆ SPECENUM_VALUE1 [1/3]

#define SPECENUM_VALUE1 TBONUS_GOLD

Definition at line 55 of file traderoutes.h.

## ◆ SPECENUM_VALUE1 [2/3]

#define SPECENUM_VALUE1 RDIR_FROM

Definition at line 55 of file traderoutes.h.

## ◆ SPECENUM_VALUE1 [3/3]

#define SPECENUM_VALUE1 GF_DEPLETES

Definition at line 55 of file traderoutes.h.

## ◆ SPECENUM_VALUE1NAME [1/3]

#define SPECENUM_VALUE1NAME "Gold"

Definition at line 56 of file traderoutes.h.

## ◆ SPECENUM_VALUE1NAME [2/3]

#define SPECENUM_VALUE1NAME N_("?routedir:From")

Definition at line 56 of file traderoutes.h.

## ◆ SPECENUM_VALUE1NAME [3/3]

#define SPECENUM_VALUE1NAME "Depletes"

Definition at line 56 of file traderoutes.h.

## ◆ SPECENUM_VALUE2 [1/3]

#define SPECENUM_VALUE2 TBONUS_SCIENCE

Definition at line 57 of file traderoutes.h.

## ◆ SPECENUM_VALUE2 [2/3]

#define SPECENUM_VALUE2 RDIR_TO

Definition at line 57 of file traderoutes.h.

## ◆ SPECENUM_VALUE2 [3/3]

#define SPECENUM_VALUE2 GF_SELF_PROVIDED

Definition at line 57 of file traderoutes.h.

## ◆ SPECENUM_VALUE2NAME [1/3]

#define SPECENUM_VALUE2NAME "Science"

Definition at line 58 of file traderoutes.h.

## ◆ SPECENUM_VALUE2NAME [2/3]

#define SPECENUM_VALUE2NAME N_("?routedir:To")

Definition at line 58 of file traderoutes.h.

## ◆ SPECENUM_VALUE2NAME [3/3]

#define SPECENUM_VALUE2NAME "Self-Provided"

Definition at line 58 of file traderoutes.h.

## ◆ SPECENUM_VALUE3 [1/2]

#define SPECENUM_VALUE3 TBONUS_BOTH

Definition at line 59 of file traderoutes.h.

## ◆ SPECENUM_VALUE3 [2/2]

#define SPECENUM_VALUE3 RDIR_BIDIRECTIONAL

Definition at line 59 of file traderoutes.h.

## ◆ SPECENUM_VALUE3NAME [1/2]

#define SPECENUM_VALUE3NAME "Both"

Definition at line 60 of file traderoutes.h.

## ◆ SPECENUM_VALUE3NAME [2/2]

#define SPECENUM_VALUE3NAME N_("?routedir:Bidirectional")

Definition at line 60 of file traderoutes.h.

## ◆ SPECLIST_TAG

#define SPECLIST_TAG trade_route

Definition at line 91 of file traderoutes.h.

## ◆ SPECLIST_TYPE

#define SPECLIST_TYPE struct trade_route

Definition at line 92 of file traderoutes.h.

## ◆ trade_partners_iterate

#define trade_partners_iterate | ( |  | c,
|  |  | p
| ) |  |

Value:
do { \
trade_routes_iterate(c, _proute_) { \
struct city *p = game_city_by_number(_proute_->partner);
game_city_by_number
struct city * game_city_by_number(int id)
Definition game.c:106
city
Definition city.h:320

Definition at line 162 of file traderoutes.h.

## ◆ trade_partners_iterate_end

#define trade_partners_iterate_end

Value:
} trade_routes_iterate_end; \
} while (FALSE);
FALSE
#define FALSE
Definition support.h:47
trade_routes_iterate_end
#define trade_routes_iterate_end
Definition traderoutes.h:135

Definition at line 167 of file traderoutes.h.

## ◆ trade_route_list_iterate

#define trade_route_list_iterate | ( |  | trade_route_list,
|  |  | proute
| ) |  | TYPED_LIST_ITERATE(struct trade_route, trade_route_list, proute)

Definition at line 95 of file traderoutes.h.

## ◆ trade_route_list_iterate_end

#define trade_route_list_iterate_end LIST_ITERATE_END

Definition at line 97 of file traderoutes.h.

## ◆ trade_routes_iterate

#define trade_routes_iterate | ( |  | c,
|  |  | proute
| ) |  |

Value:
do { \
trade_route_list_iterate(c->routes, proute) {

Definition at line 131 of file traderoutes.h.

## ◆ trade_routes_iterate_end

#define trade_routes_iterate_end

Value:
} trade_route_list_iterate_end; \
} while (FALSE)
trade_route_list_iterate_end
#define trade_route_list_iterate_end
Definition traderoutes.h:97

Definition at line 135 of file traderoutes.h.

## ◆ trade_routes_iterate_safe

#define trade_routes_iterate_safe | ( |  | c,
|  |  | proute
| ) |  |

Value:
{ \
struct city *c##_proute = c; \
int _routes##_size = trade_route_list_size(c##_proute->routes); \
\
if (_routes##_size > 0) { \
struct trade_route *_routes##_saved[_routes##_size]; \
int _routes##_index; \
\
_routes##_size = 0; \
trade_routes_iterate(c##_proute, _proute) { \
_routes##_saved[_routes##_size++] = _proute; \
} trade_routes_iterate_end; \
for (_routes##_index = 0; \
_routes##_index < _routes##_size; \
_routes##_index++) { \
struct trade_route *proute = _routes##_saved[_routes##_index];
trade_route
Definition traderoutes.h:83

Definition at line 139 of file traderoutes.h.

## ◆ trade_routes_iterate_safe_end

#define trade_routes_iterate_safe_end

Value:
} \
} \
}

Definition at line 157 of file traderoutes.h.

## Enumeration Type Documentation

## ◆ trade_route_illegal_cancelling

enum trade_route_illegal_cancelling

Enumerator
TRI_ACTIVE |
TRI_INACTIVE |
TRI_CANCEL |
TRI_LAST |

Definition at line 28 of file traderoutes.h.

## ◆ trade_route_type

enum trade_route_type

Enumerator
TRT_NATIONAL |
TRT_NATIONAL_IC |
TRT_IN |
TRT_IN_IC |
TRT_ALLY |
TRT_ALLY_IC |
TRT_ENEMY |
TRT_ENEMY_IC |
TRT_TEAM |
TRT_TEAM_IC |
TRT_LAST |

Definition at line 37 of file traderoutes.h.

## Function Documentation

## ◆ can_cities_trade()

bool can_cities_trade | ( | const struct city * | pc1,
|  | const struct city * | pc2
| ) |  |

Return TRUE iff the two cities are capable of trade; i.e., if a caravan from one city can enter the other to sell its goods.

See also can_establish_trade_route().

Definition at line 214 of file traderoutes.c.

Referenced by actres_possible(), can_establish_trade_route(), city_receives_goods(), dai_caravan_can_trade_cities_diff_cont(), dai_choose_trade_route(), dai_manage_caravan(), do_unit_establish_trade(), popup_info_text(), real_menus_update(), reestablish_city_trade_routes(), set_city_production(), trade_benefit(), unit_can_est_trade_route_here(), update_city_activities(), and windfall_benefit().

## ◆ can_establish_trade_route()

bool can_establish_trade_route | ( | const struct city * | pc1,
|  | const struct city * | pc2,
|  | int | priority
| ) |  |

Returns TRUE iff the two cities can establish a trade route. We look at the distance and ownership of the cities as well as their existing trade routes. Should only be called if you already know that can_cities_trade().

Definition at line 283 of file traderoutes.c.

Referenced by actres_possible(), trade_generator::calculate_inner(), dai_manage_caravan(), popup_info_text(), real_menus_update(), reestablish_city_trade_routes(), trade_benefit(), and windfall_benefit().

## ◆ cities_trade_route_type()

enum trade_route_type cities_trade_route_type | ( | const struct city * | pcity1,
|  | const struct city * | pcity2
| ) |  |

What is type of the trade route between two cities.

Definition at line 58 of file traderoutes.c.

Referenced by can_cities_trade(), city_receives_goods(), do_unit_establish_trade(), get_caravan_enter_city_trade_bonus(), reestablish_city_trade_routes(), set_city_production(), trade_base_between_cities(), update_city_activities(), and windfall_benefit().

## ◆ city_num_trade_routes()

int city_num_trade_routes | ( | const struct city * | pcity | ) |

Return number of trade route city has

Definition at line 392 of file traderoutes.c.

Referenced by adjust_improvement_wants_by_effects(), trade_generator::calculate(), can_establish_trade_route(), dai_choose_trade_route(), dai_effect_value(), do_unit_establish_trade(), handle_city_info(), one_city_trade_benefit(), and sg_save_player_cities().

## ◆ city_receives_goods()

bool city_receives_goods | ( | const struct city * | pcity,
|  | const struct goods_type * | pgood
| ) |  |

Does city receive goods

Definition at line 710 of file traderoutes.c.

Referenced by is_good_req_active().

## ◆ city_trade_removable()

int city_trade_removable | ( | const struct city * | pcity,
|  | int | priority,
|  | struct trade_route_list * | would_remove
| ) |  |

Return the minimum value of the sum of trade routes which could be replaced by a new one. The target routes to be removed will be put into 'would_remove', if set.

Definition at line 231 of file traderoutes.c.

Referenced by can_establish_trade_route(), do_unit_establish_trade(), and one_city_trade_benefit().

## ◆ get_caravan_enter_city_trade_bonus()

int get_caravan_enter_city_trade_bonus | ( | const struct city * | pc1,
|  | const struct city * | pc2,
|  | const struct unit_type * | ut,
|  | struct goods_type * | pgood,
|  | const bool | establish_trade
| ) |  |

Returns the revenue trade bonus - you get this when establishing a trade route and also when you simply sell your trade goods at the new city.

If you change this calculation remember to also update its duplication in dai_choose_trade_route()

pgood can be NULL for ignoring good's onetime_pct.

Definition at line 476 of file traderoutes.c.

Referenced by do_unit_establish_trade(), get_act_sel_action_custom_text(), real_menus_update(), and windfall_benefit().

## ◆ goods_by_number()

struct goods_type * goods_by_number | ( | Goods_type_id | id | ) |

Return goods type of given id.

Definition at line 620 of file traderoutes.c.

Referenced by tab_good::add_now(), handle_ruleset_goods(), handle_trade_route_info(), sg_load_player_city(), sg_save_player_cities(), universal_by_number(), universal_value_initial(), and unpackage_unit().

## ◆ goods_by_rule_name()

struct goods_type * goods_by_rule_name | ( | const char * | name | ) |

Returns goods type matching rule name or NULL if there is no goods type with such name.

Definition at line 647 of file traderoutes.c.

Referenced by tab_good::initialize_new_good(), tab_good::select_good(), sg_load_player_city(), sg_load_player_unit(), and universal_value_from_str().

## ◆ goods_by_translated_name()

struct goods_type * goods_by_translated_name | ( | const char * | name | ) |

Returns goods type matching the translated name, or NULL if there is no goods type with that name.

Definition at line 670 of file traderoutes.c.

Referenced by help_update_goods(), and help_widget::set_topic_goods().

## ◆ goods_can_be_provided()

bool goods_can_be_provided | ( | const struct city * | pcity,
|  | const struct goods_type * | pgood,
|  | const struct unit * | punit
| ) |  |

Can the city provide goods.

Definition at line 692 of file traderoutes.c.

Referenced by goods_from_city_to_unit(), is_good_req_active(), and update_city_activities().

## ◆ goods_free()

void goods_free | ( | void |  | ) |

Free the memory associated with goods

Definition at line 580 of file traderoutes.c.

Referenced by game_ruleset_free().

## ◆ goods_from_city_to_unit()

struct goods_type * goods_from_city_to_unit | ( | const struct city * | src,
|  | const struct unit * | punit
| ) |  |

Fond out goods type for the new trade route

Parameters

  src | City to start traderoute from
  punit | Unit to carry the goods

Returns
  Goods to carry

Definition at line 743 of file traderoutes.c.

Referenced by get_discounted_reward(), unit_current_goods(), and unit_get_goods().

## ◆ goods_has_flag()

bool goods_has_flag | ( | const struct goods_type * | pgood,
|  | enum goods_flag_id | flag
| ) |  |

Check if goods has given flag

Definition at line 684 of file traderoutes.c.

Referenced by do_unit_establish_trade(), is_good_req_active(), save_game_ruleset(), and update_city_activities().

## ◆ goods_index()

Goods_type_id goods_index | ( | const struct goods_type * | pgood | ) |

Return the goods index.

Currently same as goods_number(), paired with goods_count() indicates use as an array index.

Definition at line 610 of file traderoutes.c.

Referenced by load_game_names(), load_ruleset_game(), package_unit(), and tab_good::refresh().

## ◆ goods_init()

void goods_init | ( | void |  | ) |

Initialize goods structures.

Definition at line 564 of file traderoutes.c.

Referenced by game_ruleset_init().

## ◆ goods_name_translation()

const char * goods_name_translation | ( | struct goods_type * | pgood | ) |

Return translated name of this goods type.

Definition at line 630 of file traderoutes.c.

Referenced by boot_help_texts(), do_unit_establish_trade(), get_city_dialog_output_text(), goods_by_translated_name(), insert_allows(), req_text_insert(), universal_name_translation(), and worklist_item_postpone_req_vec().

## ◆ goods_number()

Goods_type_id goods_number | ( | const struct goods_type * | pgood | ) |

Return the goods id.

Definition at line 597 of file traderoutes.c.

Referenced by package_city(), send_ruleset_goods(), and universal_number().

## ◆ goods_rule_name()

const char * goods_rule_name | ( | struct goods_type * | pgood | ) |

Return untranslated name of this goods type.

Definition at line 638 of file traderoutes.c.

Referenced by tab_good::delete_now(), tab_good::edit_effects(), tab_good::edit_reqs(), goods_by_rule_name(), is_universal_needed(), load_ruleset_game(), tab_good::name_given(), tab_good::refresh(), sanity_check_ruleset_data(), sg_save_player_cities(), sg_save_player_units(), universal_kind_values(), universal_rule_name(), and tab_good::update_good_info().

## ◆ have_cities_trade_route()

bool have_cities_trade_route | ( | const struct city * | pc1,
|  | const struct city * | pc2
| ) |  |

Check if cities have an established trade route.

Definition at line 550 of file traderoutes.c.

Referenced by trade_generator::calculate_inner(), can_establish_trade_route(), do_unit_establish_trade(), and draw_calculated_trade_routes().

## ◆ max_trade_prod()

int max_trade_prod | ( | const struct city * | pcity | ) |

Returns the maximum trade production of a city.

Definition at line 453 of file traderoutes.c.

Referenced by dai_choose_trade_route(), and get_caravan_enter_city_trade_bonus().

## ◆ max_trade_routes()

unsigned max_trade_routes | ( | const struct city * | pcity | ) |

Return current maximum number of trade routes city can have.

Definition at line 48 of file traderoutes.c.

Referenced by trade_generator::calculate(), trade_generator::calculate_inner(), can_establish_trade_route(), trade_generator::check_if_done(), city_trade_removable(), dai_choose_trade_route(), dai_effect_value(), do_unit_establish_trade(), get_city_mapview_trade_routes(), one_city_trade_benefit(), and trade_benefit().

## ◆ trade_base_between_cities()

int trade_base_between_cities | ( | const struct city * | pc1,
|  | const struct city * | pc2
| ) |  |

Return the trade that exists between these cities, assuming they have a trade route.

Definition at line 331 of file traderoutes.c.

Referenced by can_establish_trade_route(), dai_effect_value(), do_unit_establish_trade(), get_act_sel_action_custom_text(), max_trade_prod(), popup_info_text(), real_menus_update(), set_city_production(), and trade_benefit().

## ◆ trade_from_route()

int trade_from_route | ( | const struct city * | pc1,
|  | const struct trade_route * | route,
|  | int | base
| ) |  |

Get trade income specific to route's good.

Definition at line 367 of file traderoutes.c.

Referenced by set_city_production().

## ◆ trade_route_cancelling_type_by_name()

enum trade_route_illegal_cancelling trade_route_cancelling_type_by_name | ( | const char * | name | ) |

Get trade route cancelling type by name.

Definition at line 184 of file traderoutes.c.

Referenced by load_ruleset_game().

## ◆ trade_route_cancelling_type_name()

const char * trade_route_cancelling_type_name | ( | enum trade_route_illegal_cancelling | type | ) |

Return human readable name of trade route cancelling type

Definition at line 174 of file traderoutes.c.

Referenced by save_game_ruleset().

## ◆ trade_route_settings_by_type()

struct trade_route_settings * trade_route_settings_by_type | ( | enum trade_route_type | type | ) |

Get trade route settings related to type.

Definition at line 201 of file traderoutes.c.

Referenced by city_receives_goods(), do_unit_establish_trade(), handle_ruleset_trade(), load_ruleset_game(), reestablish_city_trade_routes(), save_game_ruleset(), send_ruleset_trade_routes(), set_city_production(), trade_route_types_init(), update_city_activities(), and windfall_benefit().

## ◆ trade_route_type_by_name()

enum trade_route_type trade_route_type_by_name | ( | const char * | name | ) |

Get trade route type by name.

Definition at line 158 of file traderoutes.c.

Referenced by load_ruleset_game().

## ◆ trade_route_type_name()

const char * trade_route_type_name | ( | enum trade_route_type | type | ) |

Return human readable name of trade route type

Definition at line 148 of file traderoutes.c.

Referenced by save_game_ruleset().

## ◆ trade_route_type_trade_pct()

int trade_route_type_trade_pct | ( | enum trade_route_type | type | ) |

Return percentage bonus for trade route type.

Definition at line 122 of file traderoutes.c.

Referenced by can_cities_trade(), dai_choose_trade_route(), and trade_base_between_cities().

## ◆ trade_route_types_init()

void trade_route_types_init | ( | void |  | ) |

Initialize trade route types.

Definition at line 134 of file traderoutes.c.

Referenced by game_ruleset_init().

## ◆ unit_current_goods()

struct goods_type * unit_current_goods | ( | const struct unit * | punit,
|  | const struct city * | homecity
| ) |  |

What goods unit would provide if it established trade route now?

Parameters

  punit | Unit to establish the trade route
  homecity | Homecity of the unit. Can be used speculatively.

Returns
  What good unit would provide

Definition at line 778 of file traderoutes.c.

Referenced by actres_possible(), dai_manage_caravan(), do_unit_establish_trade(), popup_info_text(), and real_menus_update().