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)
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
22 #include "bitvector.h"
23 #include "string_vector.h"
27 #include "name_translation.h"
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 */
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_) \
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 \
69 #endif /* FC__MULTIPLIERS_H */