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

Freeciv-3.3

Loading...
Searching...
No Matches
Data Structures | Macros | Enumerations | Functions
tech.h File Reference
`#include "bitvector.h"`
`#include "shared.h"`
`#include "fc_types.h"`
`#include "name_translation.h"`
`#include "requirements.h"`
`#include "specenum_gen.h"`

Go to the source code of this file.

## Data Structures

struct | tech_class
struct | advance

## Macros

#define | A_NONE 0
#define | A_FIRST 1
#define | A_LAST (MAX_NUM_ADVANCES + 1) /* Used in the network protocol. */
#define | A_FUTURE (A_LAST + 1)
#define | A_ARRAY_SIZE (A_FUTURE + 1)
#define | A_UNSET (A_LAST + 2)
#define | A_UNKNOWN (A_LAST + 3)
#define | A_NEVER (NULL)
#define | SPECENUM_NAME tech_flag_id
#define | SPECENUM_VALUE0 TF_BONUS_TECH
#define | SPECENUM_VALUE0NAME N_("Bonus_Tech")
#define | SPECENUM_VALUE1 TF_BRIDGE
#define | SPECENUM_VALUE1NAME N_("Bridge")
#define | SPECENUM_VALUE2 TF_BUILD_AIRBORNE
#define | SPECENUM_VALUE2NAME N_("Build_Airborne")
#define | SPECENUM_VALUE3 TF_CLAIM_OCEAN
#define | SPECENUM_VALUE3NAME N_("Claim_Ocean")
#define | SPECENUM_VALUE4 TF_CLAIM_OCEAN_LIMITED
#define | SPECENUM_VALUE4NAME N_("Claim_Ocean_Limited")
#define | SPECENUM_VALUE5 TECH_USER_1
#define | SPECENUM_VALUE6 TECH_USER_2
#define | SPECENUM_VALUE7 TECH_USER_3
#define | SPECENUM_VALUE8 TECH_USER_4
#define | SPECENUM_VALUE9 TECH_USER_5
#define | SPECENUM_VALUE10 TECH_USER_6
#define | SPECENUM_VALUE11 TECH_USER_7
#define | SPECENUM_VALUE12 TECH_USER_LAST
#define | SPECENUM_COUNT TF_COUNT
#define | SPECENUM_BITVECTOR bv_tech_flags
#define | SPECENUM_NAMEOVERRIDE
#define | MAX_NUM_USER_TECH_FLAGS (TECH_USER_LAST - TECH_USER_1 + 1)
#define | tech_class_index(_ptclass_) (_ptclass_)->idx
#define | tech_class_iterate(_p)
#define | tech_class_iterate_end
#define | tech_class_re_active_iterate(_p)
#define | tech_class_re_active_iterate_end
#define | advance_index_iterate(_start, _index)
#define | advance_index_iterate_end
#define | advance_index_iterate_max(_start, _index, _max)
#define | advance_index_iterate_max_end
#define | advance_iterate_base(_start, _p)
#define | advance_iterate_base_end
#define | advance_iterate(_p) advance_iterate_base(A_FIRST, _p)
#define | advance_iterate_end advance_iterate_base_end
#define | advance_iterate_all(_p) advance_iterate_base(A_NONE, _p)
#define | advance_iterate_all_end advance_iterate_base_end
#define | advance_re_active_iterate(_p)
#define | advance_re_active_iterate_end
#define | advance_req_iterate(_goal, _padvance)
#define | advance_req_iterate_end generic_iterate_end
#define | advance_root_req_iterate(_goal, _padvance)
#define | advance_root_req_iterate_end generic_iterate_end

## Enumerations

enum | tech_req { AR_ONE = 0 , AR_TWO = 1 , AR_ROOT = 2 , AR_SIZE }

## Functions

| BV_DEFINE (bv_techs, A_ARRAY_SIZE)
Tech_type_id | advance_count_real (void)
static Tech_type_id | advance_count (void)
Tech_type_id | advance_index (const struct advance *padvance)
Tech_type_id | advance_number (const struct advance *padvance)
struct advance * | advance_by_number (const Tech_type_id atype)
struct advance * | valid_advance (struct advance *padvance)
struct advance * | valid_advance_by_number (const Tech_type_id atype)
struct advance * | advance_by_rule_name (const char *name)
struct advance * | advance_by_translated_name (const char *name)
const char * | advance_rule_name (const struct advance *padvance)
const char * | advance_name_translation (const struct advance *padvance)
void | tech_classes_init (void)
struct tech_class * | tech_class_by_number (const int idx)
const char * | tech_class_name_translation (const struct tech_class *ptclass)
const char * | tech_class_rule_name (const struct tech_class *ptclass)
struct tech_class * | tech_class_by_rule_name (const char *name)
void | user_tech_flags_init (void)
void | user_tech_flags_free (void)
void | set_user_tech_flag_name (enum tech_flag_id id, const char *name, const char *helptxt)
const char * | tech_flag_helptxt (enum tech_flag_id id)
bool | advance_has_flag (Tech_type_id tech, enum tech_flag_id flag)
Tech_type_id | advance_required (const Tech_type_id tech, enum tech_req require)
struct advance * | advance_requires (const struct advance *padvance, enum tech_req require)
bool | techs_have_fixed_costs (void)
bool | is_future_tech (Tech_type_id tech)
bool | is_regular_advance (struct advance *padvance)
void | techs_init (void)
void | techs_free (void)
void | techs_precalc_data (void)
const struct advance * | advance_array_last (void)
size_t | advance_req_iter_sizeof (void)
struct iterator * | advance_req_iter_init (struct advance_req_iter *it, const struct advance *goal)
size_t | advance_root_req_iter_sizeof (void)
struct iterator * | advance_root_req_iter_init (struct advance_root_req_iter *it, const struct advance *goal)

## Macro Definition Documentation

## ◆ A_ARRAY_SIZE

#define A_ARRAY_SIZE (A_FUTURE + 1)

Definition at line 47 of file tech.h.

## ◆ A_FIRST

#define A_FIRST 1

Definition at line 44 of file tech.h.

## ◆ A_FUTURE

#define A_FUTURE (A_LAST + 1)

Definition at line 46 of file tech.h.

## ◆ A_LAST

#define A_LAST (MAX_NUM_ADVANCES + 1) /* Used in the network protocol. */

Definition at line 45 of file tech.h.

## ◆ A_NEVER

#define A_NEVER (NULL)

Definition at line 51 of file tech.h.

## ◆ A_NONE

#define A_NONE 0

Definition at line 43 of file tech.h.

## ◆ A_UNKNOWN

#define A_UNKNOWN (A_LAST + 3)

Definition at line 49 of file tech.h.

## ◆ A_UNSET

#define A_UNSET (A_LAST + 2)

Definition at line 48 of file tech.h.

## ◆ advance_index_iterate

#define advance_index_iterate | ( |  | _start,
|  |  | _index
| ) |  |

Value:
{ \
advance_index_iterate_max(_start, _index, advance_count())
incite_cost
char * incite_cost
Definition comments.c:74
advance_count
static Tech_type_id advance_count(void)
Definition tech.h:170

Definition at line 245 of file tech.h.

## ◆ advance_index_iterate_end

#define advance_index_iterate_end

Value:
advance_index_iterate_max_end \
}
advance_index_iterate_max_end
#define advance_index_iterate_max_end
Definition tech.h:259

Definition at line 249 of file tech.h.

## ◆ advance_index_iterate_max

#define advance_index_iterate_max | ( |  | _start,
|  |  | _index,
|  |  | _max
| ) |  |

Value:
{ \
Tech_type_id _index = (_start); \
Tech_type_id _aco_##_index = (_max); \
for (; _index < _aco_##_index; _index++) {
Tech_type_id
int Tech_type_id
Definition fc_types.h:381

Definition at line 253 of file tech.h.

## ◆ advance_index_iterate_max_end

#define advance_index_iterate_max_end

Value:
} \
}

Definition at line 259 of file tech.h.

## ◆ advance_iterate

#define advance_iterate | ( |  | _p | ) | advance_iterate_base(A_FIRST, _p)

Definition at line 276 of file tech.h.

## ◆ advance_iterate_all

#define advance_iterate_all | ( |  | _p | ) | advance_iterate_base(A_NONE, _p)

Definition at line 279 of file tech.h.

## ◆ advance_iterate_all_end

#define advance_iterate_all_end advance_iterate_base_end

Definition at line 280 of file tech.h.

## ◆ advance_iterate_base

#define advance_iterate_base | ( |  | _start,
|  |  | _p
| ) |  |

Value:
{ \
struct advance *_p = advance_by_number(_start); \
if (NULL != _p) { \
for (; _p <= advance_array_last(); _p++) {
advance
Definition tech.h:124
advance_by_number
struct advance * advance_by_number(const Tech_type_id atype)
Definition tech.c:107
advance_array_last
const struct advance * advance_array_last(void)
Definition tech.c:67

Definition at line 265 of file tech.h.

## ◆ advance_iterate_base_end

#define advance_iterate_base_end

Value:
} \
} \
}

Definition at line 271 of file tech.h.

## ◆ advance_iterate_end

#define advance_iterate_end advance_iterate_base_end

Definition at line 277 of file tech.h.

## ◆ advance_re_active_iterate

#define advance_re_active_iterate | ( |  | _p | ) |

Value:
advance_iterate(_p) { \
if (_p->require[AR_ONE] != A_NEVER) {
A_NEVER
#define A_NEVER
Definition tech.h:51
AR_ONE
@ AR_ONE
Definition tech.h:111
advance_iterate
#define advance_iterate(_p)
Definition tech.h:276

Definition at line 282 of file tech.h.

## ◆ advance_re_active_iterate_end

#define advance_re_active_iterate_end

Value:
} \
} advance_iterate_end;
advance_iterate_end
#define advance_iterate_end
Definition tech.h:277

Definition at line 286 of file tech.h.

## ◆ advance_req_iterate

#define advance_req_iterate | ( |  | _goal,
|  |  | _padvance
| ) |  |

Value:
generic_iterate(struct advance_req_iter, const struct advance *, \
_padvance, advance_req_iter_sizeof, advance_req_iter_init,\
_goal)
generic_iterate
#define generic_iterate(TYPE_it, TYPE_a, NAME_a, FUNC_size, FUNC_init,...)
Definition iterator.h:117
advance_req_iter
Definition tech.c:38
advance_req_iter_init
struct iterator * advance_req_iter_init(struct advance_req_iter *it, const struct advance *goal)
Definition tech.c:592
advance_req_iter_sizeof
size_t advance_req_iter_sizeof(void)
Definition tech.c:536

Definition at line 300 of file tech.h.

## ◆ advance_req_iterate_end

#define advance_req_iterate_end generic_iterate_end

Definition at line 304 of file tech.h.

## ◆ advance_root_req_iterate

#define advance_root_req_iterate | ( |  | _goal,
|  |  | _padvance
| ) |  |

Value:
generic_iterate(struct advance_root_req_iter, const struct advance *, \
_padvance, advance_root_req_iter_sizeof, \
advance_root_req_iter_init, \
_goal)
advance_root_req_iter
Definition tech.c:46
advance_root_req_iter_sizeof
size_t advance_root_req_iter_sizeof(void)
Definition tech.c:612
advance_root_req_iter_init
struct iterator * advance_root_req_iter_init(struct advance_root_req_iter *it, const struct advance *goal)
Definition tech.c:695

Definition at line 315 of file tech.h.

## ◆ advance_root_req_iterate_end

#define advance_root_req_iterate_end generic_iterate_end

Definition at line 320 of file tech.h.

## ◆ MAX_NUM_USER_TECH_FLAGS

#define MAX_NUM_USER_TECH_FLAGS (TECH_USER_LAST - TECH_USER_1 + 1)

Definition at line 108 of file tech.h.

## ◆ SPECENUM_BITVECTOR

#define SPECENUM_BITVECTOR bv_tech_flags

Definition at line 104 of file tech.h.

## ◆ SPECENUM_COUNT

#define SPECENUM_COUNT TF_COUNT

Definition at line 103 of file tech.h.

## ◆ SPECENUM_NAME

#define SPECENUM_NAME tech_flag_id

Definition at line 75 of file tech.h.

## ◆ SPECENUM_NAMEOVERRIDE

#define SPECENUM_NAMEOVERRIDE

Definition at line 105 of file tech.h.

## ◆ SPECENUM_VALUE0

#define SPECENUM_VALUE0 TF_BONUS_TECH

Definition at line 77 of file tech.h.

## ◆ SPECENUM_VALUE0NAME

#define SPECENUM_VALUE0NAME N_("Bonus_Tech")

Definition at line 80 of file tech.h.

## ◆ SPECENUM_VALUE1

#define SPECENUM_VALUE1 TF_BRIDGE

Definition at line 82 of file tech.h.

## ◆ SPECENUM_VALUE10

#define SPECENUM_VALUE10 TECH_USER_6

Definition at line 99 of file tech.h.

## ◆ SPECENUM_VALUE11

#define SPECENUM_VALUE11 TECH_USER_7

Definition at line 100 of file tech.h.

## ◆ SPECENUM_VALUE12

#define SPECENUM_VALUE12 TECH_USER_LAST

Definition at line 101 of file tech.h.

## ◆ SPECENUM_VALUE1NAME

#define SPECENUM_VALUE1NAME N_("Bridge")

Definition at line 83 of file tech.h.

## ◆ SPECENUM_VALUE2

#define SPECENUM_VALUE2 TF_BUILD_AIRBORNE

Definition at line 85 of file tech.h.

## ◆ SPECENUM_VALUE2NAME

#define SPECENUM_VALUE2NAME N_("Build_Airborne")

Definition at line 86 of file tech.h.

## ◆ SPECENUM_VALUE3

#define SPECENUM_VALUE3 TF_CLAIM_OCEAN

Definition at line 88 of file tech.h.

## ◆ SPECENUM_VALUE3NAME

#define SPECENUM_VALUE3NAME N_("Claim_Ocean")

Definition at line 89 of file tech.h.

## ◆ SPECENUM_VALUE4

#define SPECENUM_VALUE4 TF_CLAIM_OCEAN_LIMITED

Definition at line 92 of file tech.h.

## ◆ SPECENUM_VALUE4NAME

#define SPECENUM_VALUE4NAME N_("Claim_Ocean_Limited")

Definition at line 93 of file tech.h.

## ◆ SPECENUM_VALUE5

#define SPECENUM_VALUE5 TECH_USER_1

Definition at line 94 of file tech.h.

## ◆ SPECENUM_VALUE6

#define SPECENUM_VALUE6 TECH_USER_2

Definition at line 95 of file tech.h.

## ◆ SPECENUM_VALUE7

#define SPECENUM_VALUE7 TECH_USER_3

Definition at line 96 of file tech.h.

## ◆ SPECENUM_VALUE8

#define SPECENUM_VALUE8 TECH_USER_4

Definition at line 97 of file tech.h.

## ◆ SPECENUM_VALUE9

#define SPECENUM_VALUE9 TECH_USER_5

Definition at line 98 of file tech.h.

## ◆ tech_class_index

#define tech_class_index | ( |  | _ptclass_ | ) | (_ptclass_)->idx

Definition at line 193 of file tech.h.

## ◆ tech_class_iterate

#define tech_class_iterate | ( |  | _p | ) |

Value:
{ \
int _i_##_p; \
for (_i_##_p = 0; _i_##_p < game.control.num_tech_classes; _i_##_p++) { \
struct tech_class *_p = tech_class_by_number(_i_##_p);
game
struct civ_game game
Definition game.c:62
civ_game::control
struct packet_ruleset_control control
Definition game.h:83
packet_ruleset_control::num_tech_classes
int num_tech_classes
Definition packets_gen.h:1461
tech_class
Definition tech.h:117
tech_class_by_number
struct tech_class * tech_class_by_number(const int idx)
Definition tech.c:330

Definition at line 198 of file tech.h.

## ◆ tech_class_iterate_end

#define tech_class_iterate_end

Value:
} \
}

Definition at line 204 of file tech.h.

## ◆ tech_class_re_active_iterate

#define tech_class_re_active_iterate | ( |  | _p | ) |

Value:
tech_class_iterate(_p) { \
if (!_p->ruledit_disabled) {
tech_class_iterate
#define tech_class_iterate(_p)
Definition tech.h:198

Definition at line 208 of file tech.h.

## ◆ tech_class_re_active_iterate_end

#define tech_class_re_active_iterate_end

Value:
} \
} tech_class_iterate_end;
tech_class_iterate_end
#define tech_class_iterate_end
Definition tech.h:204

Definition at line 212 of file tech.h.

## Enumeration Type Documentation

## ◆ tech_req

enum tech_req

Enumerator
AR_ONE |
AR_TWO |
AR_ROOT |
AR_SIZE |

Definition at line 110 of file tech.h.

## Function Documentation

## ◆ advance_array_last()

const struct advance * advance_array_last | ( | void |  | ) |

Return the last item of advances/technologies.

Definition at line 67 of file tech.c.

## ◆ advance_by_number()

struct advance * advance_by_number | ( | const Tech_type_id | atype | ) |

Return the advance for the given advance index.

Definition at line 107 of file tech.c.

Referenced by tab_tech::add_now(), advance_has_flag(), help_widget::anchor_clicked(), api_edit_give_technology(), api_find_tech_type(), api_methods_player_researching(), boot_help_texts(), client_diplomacy_clause_string(), create_select_tech_icon(), create_tech_info(), create_tech_tree(), research_diagram::create_tooltip_help(), dai_goldequiv_clause(), dai_manage_government(), dai_manage_tech(), dai_select_tech(), do_tech_parasite_effects(), draw_reqtree(), found_new_tech(), get_tooltip_unit(), handle_diplomacy_accept_treaty_req(), handle_ruleset_tech(), help_hyperlink_callback(), help_tech_tree_activated_callback(), help_update_tech(), helptext_advance(), helptext_extra(), helptext_nation(), init_tech(), tab_tech::initialize_new_tech(), load_ruleset_techs(), research_diagram::mouseMoveEvent(), node_rectangle_minimum_size(), popup_change_research_dialog(), popup_change_research_goal_dialog(), popup_diplomatic_objects(), real_science_report_dialog_update(), real_tech_log(), research_advance_name(), research_get_reachable(), research_get_root_reqs_known(), research_tech_lost(), research_update(), sanity_check_ruleset_data(), save_tech_list(), save_techs_ruleset(), side_right_click_science(), spy_steal_popup_shared(), steal_a_tech(), tech_researched(), technology_save(), universal_by_number(), universal_value_initial(), unpack_tech_req(), update_intel_dialog(), science_report::update_report(), utype_primary_tech_req(), and valid_advance_by_number().

## ◆ advance_by_rule_name()

struct advance * advance_by_rule_name | ( | const char * | name | ) |

Does a linear search of advances[].name.vernacular Returns NULL when none match.

Definition at line 200 of file tech.c.

Referenced by api_find_tech_type_by_name(), tab_tech::initialize_new_tech(), load_ruleset_terrain(), lookup_tech(), lookup_tech_list(), tab_tech::req1_menu(), tab_tech::req2_menu(), tab_tech::root_req_menu(), tab_tech::select_tech(), sg_load_game(), sg_load_game(), sg_load_researches(), sg_load_researches(), technology_load(), technology_load(), and universal_value_from_str().

## ◆ advance_by_translated_name()

struct advance * advance_by_translated_name | ( | const char * | name | ) |

Does a linear search of advances[].name.translated Returns NULL when none match.

Definition at line 185 of file tech.c.

Referenced by help_update_tech(), help_dialog::make_tree(), and help_widget::set_topic_tech().

## ◆ advance_count()

static Tech_type_id advance_count | ( | void |  | ) |

inlinestatic

Inline wrapper for advance_count_real() that makes it clear to the compiler that the value returned never exceeds A_LAST. Making actual advance_count_real() inline would be more complicated due to header interdependencies.

Definition at line 170 of file tech.h.

Referenced by create_dummy_reqtree(), dai_select_tech(), extviewer_view_cell_toggled(), get_req_source_effects(), get_tech_sprite(), handle_research_info(), init_tech(), package_research_info(), pick_random_tech_to_lose(), popup_change_research_dialog(), popup_change_research_goal_dialog(), popup_diplomatic_objects(), research_update(), science_report_update(), send_ruleset_techs(), spy_steal_popup_shared(), steal_a_tech(), suggest_tech_exchange(), and science_report::update_report().

## ◆ advance_count_real()

Tech_type_id advance_count_real | ( | void |  | ) |

Return the number of advances/technologies.

Definition at line 78 of file tech.c.

Referenced by advance_count().

## ◆ advance_has_flag()

bool advance_has_flag | ( | Tech_type_id | tech,
|  | enum tech_flag_id | flag
| ) |  |

Return TRUE if the tech has this flag otherwise FALSE

Definition at line 216 of file tech.c.

Referenced by found_new_tech(), helptext_advance(), research_update(), and save_techs_ruleset().

## ◆ advance_index()

Tech_type_id advance_index | ( | const struct advance * | padvance | ) |

Return the advance index.

Currently same as advance_number(), paired with advance_count() indicates use as an array index.

Definition at line 89 of file tech.c.

Referenced by api_methods_player_tech_cost(), dai_choose_diplomat_defensive(), dai_choose_paratrooper(), dai_process_defender_want(), dai_tech_effect_values(), dai_wants_defender_against(), dai_wants_role_unit(), extviewer_refresh_widgets(), find_best_city_placement(), process_attacker_want(), real_tech_log(), tab_tech::refresh(), save_techs_ruleset(), sg_load_researches(), sg_save_savefile(), tileset_setup_tech_type(), and want_tech_for_improvement_effect().

## ◆ advance_name_translation()

const char * advance_name_translation | ( | const struct advance * | padvance | ) |

Return the (translated) name of the given advance/technology. You don't have to free the return pointer.

Definition at line 300 of file tech.c.

Referenced by advance_by_translated_name(), help_widget::anchor_clicked(), api_methods_tech_type_name_translation(), boot_help_texts(), client_diplomacy_clause_string(), go_act_menu::create(), create_clause_menu(), create_tech_info(), create_tech_tree(), extviewer_refresh_widgets(), get_tooltip_improvement(), get_tooltip_unit(), handle_diplomacy_accept_treaty_req(), help_hyperlink_callback(), help_tech_tree_activated_callback(), help_update_tech(), help_update_unit_type(), help_update_wonder(), helptext_advance(), helptext_building(), helptext_extra(), helptext_nation(), manual_techs(), research_diagram::mouseMoveEvent(), popup_add_menu(), popup_change_research_dialog(), popup_change_research_goal_dialog(), popup_diplomatic_objects(), popup_impr_info(), popup_tech_info(), popup_unit_info(), real_menus_init(), real_menus_update(), req_text_insert(), help_widget::set_topic_building(), help_widget::set_topic_unit(), diplo_wdg::show_menu(), show_tech_gained_dialog(), side_right_click_science(), sort_advance_names(), spy_steal_popup_shared(), universal_name_translation(), update_intel_dialog(), science_report::update_report(), worklist_change_build_target(), and worklist_item_postpone_req_vec().

## ◆ advance_number()

Tech_type_id advance_number | ( | const struct advance * | padvance | ) |

Return the advance index.

Definition at line 98 of file tech.c.

Referenced by adjust_improvement_wants_by_effects(), adv_best_government(), advance_req_iter_next(), advance_required(), advance_root_req_iter_init(), advance_root_req_iter_next(), diplo_wdg::all_advances(), api_edit_give_technology(), api_edit_player_give_bulbs(), api_method_player_can_research(), api_methods_player_knows_tech(), api_methods_player_tech_bulbs(), choose_tech_to_steal(), go_act_menu::create(), create_clause_menu(), create_select_tech_icon(), create_tech_info(), research_diagram::create_tooltip_help(), dai_gov_value(), dai_process_defender_want(), dai_tech_base_want(), dai_tech_effect_values(), dai_wants_defender_against(), dai_wants_role_unit(), diplomacy_dialog_tech_callback(), diplomacy_dialog_tech_callback(), draw_reqtree(), handle_ruleset_tech(), help_update_tech(), help_update_unit_type(), helptext_advance(), is_tech_needed(), is_tech_req_active(), load_ruleset_terrain(), lookup_tech_list(), help_dialog::make_tree(), nation_has_initial_tech(), plr_widget::nation_selected(), node_rectangle_minimum_size(), player_tech_upkeep(), popup_add_menu(), popup_impr_info(), popup_unit_info(), process_attacker_want(), real_science_report_dialog_update(), real_tech_log(), recalculate_techs_researched(), tab_tech::req1_jump(), tab_tech::req2_jump(), research_get_reachable(), research_get_root_reqs_known(), research_goal_step(), research_update(), tab_tech::root_req_jump(), send_ruleset_techs(), help_widget::set_topic_tech(), help_widget::set_topic_unit(), sg_load_game(), sg_load_game(), sg_load_researches(), sg_load_researches(), diplo_wdg::show_menu(), spy_steal_popup_shared(), tech_can_be_stolen(), technology_load(), technology_load(), unit_goto_and_callback(), unit_goto_and_callback(), universal_number(), and worklist_change_build_target().

## ◆ advance_req_iter_init()

struct iterator * advance_req_iter_init | ( | struct advance_req_iter * | it,
|  | const struct advance * | goal
| ) |  |

Initialize an advance requirements iterator.

Definition at line 592 of file tech.c.

## ◆ advance_req_iter_sizeof()

size_t advance_req_iter_sizeof | ( | void |  | ) |

Return the size of the advance requirements iterator.

Definition at line 536 of file tech.c.

## ◆ advance_required()

Tech_type_id advance_required | ( | const Tech_type_id | tech,
|  | enum tech_req | require
| ) |  |

Accessor for requirements.

Definition at line 121 of file tech.c.

Referenced by advance_root_req_iter_init(), advance_root_req_iter_next(), create_dummy_reqtree(), create_tech_info(), create_tech_tree(), create_tech_tree(), pick_random_tech_to_lose(), redraw_tech_tree_dlg(), research_get_reachable_rreqs(), research_update(), and tech_transfer().

## ◆ advance_requires()

struct advance * advance_requires | ( | const struct advance * | padvance,
|  | enum tech_req | require
| ) |  |

Accessor for requirements.

Definition at line 136 of file tech.c.

Referenced by advance_req_iter_next(), advance_root_req_iter_get(), advance_root_req_iter_next(), help_update_tech(), helptext_advance(), research_get_reachable(), and sanity_check_ruleset_data().

## ◆ advance_root_req_iter_init()

struct iterator * advance_root_req_iter_init | ( | struct advance_root_req_iter * | it,
|  | const struct advance * | goal
| ) |  |

Initialize a root requirements iterator.

Definition at line 695 of file tech.c.

## ◆ advance_root_req_iter_sizeof()

size_t advance_root_req_iter_sizeof | ( | void |  | ) |

Return the size of the advance root requirements iterator.

Definition at line 612 of file tech.c.

## ◆ advance_rule_name()

const char * advance_rule_name | ( | const struct advance * | padvance | ) |

Return the (untranslated) rule name of the advance/technology. You don't have to free the return pointer.

Definition at line 309 of file tech.c.

Referenced by advance_by_rule_name(), api_methods_tech_type_rule_name(), dai_choose_paratrooper(), dai_goldequiv_clause(), dai_select_tech(), tab_tech::delete_now(), tab_tech::edit_effects(), edit_tech::edit_tech(), handle_diplomacy_accept_treaty_req(), init_tech(), is_tech_needed(), load_ruleset_techs(), load_ruleset_units(), tab_tech::name_given(), real_tech_log(), tab_tech::refresh(), research_tech_lost(), research_update(), sanity_check_ruleset_data(), save_tech_list(), save_tech_ref(), sg_save_savefile(), tab_tech::tech_name(), technology_save(), tileset_setup_tech_type(), universal_kind_values(), and universal_rule_name().

## ◆ BV_DEFINE()

BV_DEFINE | ( | bv_techs | ,
|  | A_ARRAY_SIZE |
| ) |  |

## ◆ is_future_tech()

bool is_future_tech | ( | Tech_type_id | tech | ) |

Is the given tech a future tech.

Definition at line 281 of file tech.c.

Referenced by adv_data_phase_init(), api_edit_give_technology(), choose_tech(), dai_select_tech(), found_new_tech(), popup_change_research_dialog(), research_tech_lost(), research_total_bulbs_required(), science_report_update(), progress_bar::set_pixmap(), sg_load_sanitycheck(), sg_load_sanitycheck(), steal_a_tech(), update_bulbs(), and science_report::update_report().

## ◆ is_regular_advance()

bool is_regular_advance | ( | struct advance * | padvance | ) |

Is the given tech an regular advance. "None" counts as regular advance, Future Tech does not.

Definition at line 290 of file tech.c.

Referenced by help_update_tech(), help_dialog::make_tree(), and help_widget::set_topic_tech().

## ◆ set_user_tech_flag_name()

void set_user_tech_flag_name | ( | enum tech_flag_id | id,
|  | const char * | name,
|  | const char * | helptxt
| ) |  |

Sets user defined name for tech flag.

Definition at line 404 of file tech.c.

Referenced by handle_ruleset_tech_flag(), and load_tech_names().

## ◆ tech_class_by_number()

struct tech_class * tech_class_by_number | ( | const int | idx | ) |

Return the tech_class for the given index.

Definition at line 330 of file tech.c.

Referenced by handle_ruleset_tech(), handle_ruleset_tech_class(), and tech_class_by_rule_name().

## ◆ tech_class_by_rule_name()

struct tech_class * tech_class_by_rule_name | ( | const char * | name | ) |

Does a linear search of tech_classes[].name.vernacular Returns NULL when none match.

Definition at line 361 of file tech.c.

Referenced by load_ruleset_techs().

## ◆ tech_class_name_translation()

const char * tech_class_name_translation | ( | const struct tech_class * | ptclass | ) |

Return the (translated) name of the given tech_class You must not free the return pointer.

Definition at line 343 of file tech.c.

Referenced by helptext_advance().

## ◆ tech_class_rule_name()

const char * tech_class_rule_name | ( | const struct tech_class * | ptclass | ) |

Return the (untranslated) rule name of tech_class You must not free the return pointer.

Definition at line 352 of file tech.c.

Referenced by save_techs_ruleset(), and tech_class_by_rule_name().

## ◆ tech_classes_init()

void tech_classes_init | ( | void |  | ) |

Initialize tech classes

Definition at line 317 of file tech.c.

Referenced by game_ruleset_init().

## ◆ tech_flag_helptxt()

const char * tech_flag_helptxt | ( | enum tech_flag_id | id | ) |

Return the (untranslated) helptxt of the user tech flag.

Definition at line 445 of file tech.c.

Referenced by helptext_advance(), save_techs_ruleset(), and send_ruleset_techs().

## ◆ techs_free()

void techs_free | ( | void |  | ) |

De-allocate resources of all techs.

Definition at line 520 of file tech.c.

Referenced by game_ruleset_free().

## ◆ techs_have_fixed_costs()

bool techs_have_fixed_costs | ( | void |  | ) |

Returns true if the costs for the given technology will stay constant during the game. False otherwise.

Checking every tech_cost_style with fixed costs seems a waste of system resources, when we can check that it is not the one style without fixed costs.

Definition at line 460 of file tech.c.

Referenced by helptext_advance().

## ◆ techs_init()

void techs_init | ( | void |  | ) |

Initialize tech structures.

Definition at line 469 of file tech.c.

Referenced by game_ruleset_init().

## ◆ techs_precalc_data()

void techs_precalc_data | ( | void |  | ) |

Function to precalculate needed data for technologies.

Definition at line 225 of file tech.c.

Referenced by load_rulesetdir().

## ◆ user_tech_flags_free()

void user_tech_flags_free | ( | void |  | ) |

Frees the memory associated with all user tech flags

Definition at line 392 of file tech.c.

Referenced by game_ruleset_free().

## ◆ user_tech_flags_init()

void user_tech_flags_init | ( | void |  | ) |

Initialize user tech flags.

Definition at line 380 of file tech.c.

Referenced by game_ruleset_init().

## ◆ valid_advance()

struct advance * valid_advance | ( | struct advance * | padvance | ) |

Returns pointer when the advance "exists" in this game, returns NULL otherwise.

A tech doesn't exist if it has been flagged as removed by setting its require values to A_NEVER. Note that this function returns NULL if either of req values is A_NEVER, rather than both, to be on the safe side.

Definition at line 152 of file tech.c.

Referenced by advance_req_iter_next(), advance_root_req_iter_next(), is_regular_advance(), load_ruleset_techs(), load_ruleset_units(), lookup_tech_list(), manual_techs(), real_tech_log(), recalculate_techs_researched(), research_get_reachable(), send_ruleset_techs(), tileset_setup_tech_type(), and valid_advance_by_number().

## ◆ valid_advance_by_number()

struct advance * valid_advance_by_number | ( | const Tech_type_id | id | ) |

Returns pointer when the advance "exists" in this game, returns NULL otherwise.

In addition to valid_advance(), tests for id is out of range.

Definition at line 176 of file tech.c.

Referenced by add_clause(), boot_help_texts(), calc_civ_score(), create_dummy_reqtree(), create_tech_tree(), dai_select_tech(), diplomat_get_tech(), found_new_tech(), handle_player_research(), handle_player_tech_goal(), helptext_advance(), init_tech(), popup_tech_info(), research_allowed(), research_get_reachable(), research_get_reachable_rreqs(), research_goal_bulbs_required(), research_goal_step(), research_goal_tech_req(), research_goal_unknown_techs(), research_invention_gettable(), research_invention_reachable(), research_invention_set(), research_invention_state(), research_tech_lost(), research_total_bulbs_required(), research_update(), sanity_check_ruleset_data(), progress_bar::set_pixmap(), sg_load_player_unit(), sg_load_sanitycheck(), sg_load_sanitycheck(), sg_save_researches(), show_tech_gained_dialog(), simple_action_callback(), simple_action_callback(), steal_a_tech(), and unit_order_list_is_sane().