Freeciv-3.4
Loading...
Searching...
No Matches
style.h
Go to the documentation of this file.
1/***********************************************************************
2 Freeciv - Copyright (C) 2005 - The Freeciv Project
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.
7
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***********************************************************************/
13
14#ifndef FC__STYLE_H
15#define FC__STYLE_H
16
17#ifdef __cplusplus
18extern "C" {
19#endif /* __cplusplus */
20
27
35
36void styles_alloc(int count);
37void styles_free(void);
38int style_count(void);
39int style_number(const struct nation_style *pstyle)
41int style_index(const struct nation_style *pstyle)
43struct nation_style *style_by_number(int id);
44const char *style_name_translation(const struct nation_style *pstyle);
45const char *style_rule_name(const struct nation_style *pstyle);
46struct nation_style *style_by_rule_name(const char *name);
47
48#define styles_iterate(_p) \
49{ \
50 int _i_; \
51 for (_i_ = 0; _i_ < game.control.num_styles; _i_++) { \
52 struct nation_style *_p = style_by_number(_i_);
53
54#define styles_iterate_end \
55 } \
56}
57
58#define styles_re_active_iterate(_p) \
59 styles_iterate(_p) { \
60 if (!_p->ruledit_disabled) {
61
62#define styles_re_active_iterate_end \
63 } \
64 } styles_iterate_end;
65
66void music_styles_alloc(int count);
67void music_styles_free(void);
68
69int music_style_number(const struct music_style *pms)
72
73struct music_style *player_music_style(struct player *plr);
74
75#define music_styles_iterate(_p) \
76{ \
77 int _i_; \
78 for (_i_ = 0; _i_ < game.control.num_music_styles; _i_++) { \
79 struct music_style *_p = music_style_by_number(_i_); \
80 if (_p != nullptr) {
81
82#define music_styles_iterate_end \
83 } \
84 } \
85}
86
87/* Deletion of music styles not supported */
88#define music_styles_re_active_iterate(_p) \
89 music_styles_iterate(_p)
90
91#define music_styles_re_active_iterate_end \
92 music_styles_iterate_end;
93
94int style_of_city(const struct city *pcity);
95
97
98int city_style(struct city *pcity);
99
100#ifdef __cplusplus
101}
102#endif /* __cplusplus */
103
104#endif /* FC__STYLE_H */
char * incite_cost
Definition comments.c:77
struct unit struct city struct unit struct tile struct extra_type const struct act_prob *act_probs int actor_unit_id struct unit struct unit int const struct action *paction struct unit struct city * pcity
Definition dialogs_g.h:78
#define MAX_LEN_NAME
Definition fc_types.h:68
const char * name
Definition inputfile.c:127
Definition city.h:318
struct requirement_vector reqs
Definition style.h:33
char music_peaceful[MAX_LEN_NAME]
Definition style.h:31
char music_combat[MAX_LEN_NAME]
Definition style.h:32
int id
Definition style.h:30
struct name_translation name
Definition style.h:24
bool ruledit_disabled
Definition style.h:25
int style_index(const struct nation_style *pstyle) fc__attribute((nonnull(1)))
Definition style.c:76
int city_style(struct city *pcity)
Definition style.c:235
void styles_free(void)
Definition style.c:51
struct nation_style * style_by_rule_name(const char *name)
Definition style.c:113
struct nation_style * style_by_number(int id)
Definition style.c:84
const char * style_name_translation(const struct nation_style *pstyle)
Definition style.c:95
int style_number(const struct nation_style *pstyle) fc__attribute((nonnull(1)))
Definition style.c:68
int music_style_number(const struct music_style *pms) fc__attribute((nonnull(1)))
Definition style.c:157
struct music_style * player_music_style(struct player *plr)
Definition style.c:179
void styles_alloc(int count)
Definition style.c:36
int style_of_city(const struct city *pcity)
Definition style.c:196
struct music_style * music_style_by_number(int id)
Definition style.c:165
const char * style_rule_name(const struct nation_style *pstyle)
Definition style.c:104
void music_styles_free(void)
Definition style.c:144
void music_styles_alloc(int count)
Definition style.c:129
int style_count(void)
Definition style.c:60
int basic_city_style_for_style(struct nation_style *pstyle)
Definition style.c:204
#define fc__attribute(x)
Definition support.h:99