Stop sharing requirement_unit_state_ereq().
[freeciv.git] / common / multipliers.h
blob04044c1e38771ab89202576f3d08dd0026c1c12d
1 /**********************************************************************
2 Freeciv - Copyright (C) 2014 - SÅ‚awomir Lach
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.
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 ***********************************************************************/
14 #ifndef FC__MULTIPLIERS_H
15 #define FC__MULTIPLIERS_H
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
21 /* utility */
22 #include "bitvector.h"
23 #include "string_vector.h"
25 /* common */
26 #include "fc_types.h"
27 #include "name_translation.h"
29 struct multiplier
31 Multiplier_type_id id;
32 struct name_translation name;
33 int start; /* display units */
34 int stop; /* display units */
35 int step; /* display units */
36 int def; /* default value, in display units */
37 int offset;
38 int factor;
39 struct strvec *helptext;
42 void multipliers_init(void);
43 void multipliers_free(void);
45 Multiplier_type_id multiplier_count(void);
46 Multiplier_type_id multiplier_index(const struct multiplier *pmul);
47 Multiplier_type_id multiplier_number(const struct multiplier *pmul);
49 struct multiplier *multiplier_by_number(Multiplier_type_id id);
51 const char *multiplier_name_translation(const struct multiplier *pmul);
52 const char *multiplier_rule_name(const struct multiplier *pmul);
53 struct multiplier *multiplier_by_rule_name(const char *name);
55 #define multipliers_iterate(_mul_) \
56 { \
57 Multiplier_type_id _i; \
58 for (_i = 0; _i < multiplier_count(); _i++) { \
59 struct multiplier *_mul_ = multiplier_by_number(_i);
61 #define multipliers_iterate_end \
62 } \
65 #ifdef __cplusplus
67 #endif
69 #endif /* FC__MULTIPLIERS_H */