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

Freeciv-3.3

Loading...
Searching...
No Matches
Data Structures | Macros | Functions
multipliers.h File Reference
`#include "bitvector.h"`
`#include "string_vector.h"`
`#include "fc_types.h"`
`#include "name_translation.h"`
`#include "requirements.h"`

Go to the source code of this file.

## Data Structures

struct | multiplier

## Macros

#define | multipliers_iterate(_mul_)
#define | multipliers_iterate_end
#define | multipliers_re_active_iterate(_mul_)
#define | multipliers_re_active_iterate_end

## Functions

void | multipliers_init (void)
void | multipliers_free (void)
Multiplier_type_id | multiplier_count (void)
Multiplier_type_id | multiplier_index (const struct multiplier *pmul)
Multiplier_type_id | multiplier_number (const struct multiplier *pmul)
struct multiplier * | multiplier_by_number (Multiplier_type_id id)
const char * | multiplier_name_translation (const struct multiplier *pmul)
const char * | multiplier_rule_name (const struct multiplier *pmul)
struct multiplier * | multiplier_by_rule_name (const char *name)
bool | multiplier_can_be_changed (struct multiplier *pmul, struct player *pplayer)

## Macro Definition Documentation

## ◆ multipliers_iterate

#define multipliers_iterate | ( |  | _mul_ | ) |

Value:
{ \
Multiplier_type_id _i; \
for (_i = 0; _i < multiplier_count(); _i++) { \
struct multiplier *_mul_ = multiplier_by_number(_i);
incite_cost
char * incite_cost
Definition comments.c:74
Multiplier_type_id
int Multiplier_type_id
Definition fc_types.h:390
multiplier_count
Multiplier_type_id multiplier_count(void)
Definition multipliers.c:88
multiplier_by_number
struct multiplier * multiplier_by_number(Multiplier_type_id id)
Definition multipliers.c:57
multiplier
Definition multipliers.h:31

Definition at line 61 of file multipliers.h.

## ◆ multipliers_iterate_end

#define multipliers_iterate_end

Value:
} \
}

Definition at line 67 of file multipliers.h.

## ◆ multipliers_re_active_iterate

#define multipliers_re_active_iterate | ( |  | _mul_ | ) |

Value:
multipliers_iterate(_mul_) { \
if (!_mul_->ruledit_disabled) {
multipliers_iterate
#define multipliers_iterate(_mul_)
Definition multipliers.h:61

Definition at line 71 of file multipliers.h.

## ◆ multipliers_re_active_iterate_end

#define multipliers_re_active_iterate_end

Value:
} \
} multipliers_iterate_end;
multipliers_iterate_end
#define multipliers_iterate_end
Definition multipliers.h:67

Definition at line 75 of file multipliers.h.

## Function Documentation

## ◆ multiplier_by_number()

struct multiplier * multiplier_by_number | ( | Multiplier_type_id | id | ) |

Returns multiplier associated to given number

Definition at line 57 of file multipliers.c.

Referenced by tab_multiplier::add_now(), handle_player_multiplier(), handle_ruleset_multiplier(), and recv_ruleset_effect().

## ◆ multiplier_by_rule_name()

struct multiplier * multiplier_by_rule_name | ( | const char * | name | ) |

Returns multiplier matching rule name, or NULL if there is no multiplier with such a name.

Definition at line 115 of file multipliers.c.

Referenced by tab_multiplier::initialize_new_multiplier(), load_ruleset_effects(), effect_edit::multiplier_menu(), tab_multiplier::select_multiplier(), sg_load_savefile(), and sg_load_savefile().

## ◆ multiplier_can_be_changed()

bool multiplier_can_be_changed | ( | struct multiplier * | pmul,
|  | struct player * | pplayer
| ) |  |

Can player change multiplier value

Definition at line 137 of file multipliers.c.

Referenced by create_multiplier_dialog(), dai_adjust_policies(), end_phase(), handle_player_multiplier(), and multipler_rates_dialog::multipler_rates_dialog().

## ◆ multiplier_count()

Multiplier_type_id multiplier_count | ( | void |  | ) |

Return number of loaded multipliers in the ruleset.

Definition at line 88 of file multipliers.c.

Referenced by handle_player_info(), handle_player_multiplier(), mr_menu::menus_sensitive(), multipliers_command_callback(), package_player_info(), real_menus_init(), real_menus_update(), sg_save_player_main(), sg_save_savefile(), and multipler_rates_dialog::slot_ok_button_pressed().

## ◆ multiplier_index()

Multiplier_type_id multiplier_index | ( | const struct multiplier * | pmul | ) |

Returns multiplier index.

Currently same as multiplier_number(), paired with multiplier_count() indicates use as an array index.

Definition at line 80 of file multipliers.c.

Referenced by create_multiplier_dialog(), dai_adjust_policies(), dai_gained_control(), end_phase(), final_ruleset_adjustments(), handle_player_info(), load_government_names(), load_ruleset_governments(), multiplier_can_be_changed(), multiplier_dialog_update_values(), multipliers_command_callback(), package_player_info(), player_multiplier_target_value(), player_multiplier_value(), tab_multiplier::refresh(), sg_load_players_basic(), sg_load_players_basic(), sg_save_savefile(), and multipler_rates_dialog::slot_ok_button_pressed().

## ◆ multiplier_name_translation()

const char * multiplier_name_translation | ( | const struct multiplier * | pmul | ) |

Return the (translated) name of the multiplier. You don't have to free the return pointer.

Definition at line 97 of file multipliers.c.

Referenced by create_multiplier_dialog(), end_phase(), get_effect_req_text(), and multipler_rates_dialog::multipler_rates_dialog().

## ◆ multiplier_number()

Multiplier_type_id multiplier_number | ( | const struct multiplier * | pmul | ) |

Returns multiplier number.

Definition at line 67 of file multipliers.c.

Referenced by multiplier_index(), send_ruleset_cache(), and send_ruleset_multipliers().

## ◆ multiplier_rule_name()

const char * multiplier_rule_name | ( | const struct multiplier * | pmul | ) |

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

Definition at line 106 of file multipliers.c.

Referenced by tab_multiplier::delete_now(), tab_multiplier::edit_reqs(), effect_edit::effect_edit(), effect_edit::fill_active(), handle_player_multiplier(), load_ruleset_governments(), multiplier_by_rule_name(), tab_multiplier::name_given(), tab_multiplier::refresh(), sg_load_players_basic(), sg_load_players_basic(), sg_save_savefile(), and tab_multiplier::update_multiplier_info().

## ◆ multipliers_free()

void multipliers_free | ( | void |  | ) |

Free all multipliers

Definition at line 43 of file multipliers.c.

Referenced by game_ruleset_free().

## ◆ multipliers_init()

void multipliers_init | ( | void |  | ) |

Initialize all multipliers

Definition at line 28 of file multipliers.c.

Referenced by game_ruleset_init().