Freeciv-3.3
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);
40int style_index(const struct nation_style *pstyle);
41struct nation_style *style_by_number(int id);
42const char *style_name_translation(const struct nation_style *pstyle);
43const char *style_rule_name(const struct nation_style *pstyle);
44struct nation_style *style_by_rule_name(const char *name);
45
46#define styles_iterate(_p) \
47{ \
48 int _i_; \
49 for (_i_ = 0; _i_ < game.control.num_styles; _i_++) { \
50 struct nation_style *_p = style_by_number(_i_);
51
52#define styles_iterate_end \
53 } \
54}
55
56#define styles_re_active_iterate(_p) \
57 styles_iterate(_p) { \
58 if (!_p->ruledit_disabled) {
59
60#define styles_re_active_iterate_end \
61 } \
62 } styles_iterate_end;
63
64void music_styles_alloc(int count);
65void music_styles_free(void);
66
67int music_style_number(const struct music_style *pms);
69
70struct music_style *player_music_style(struct player *plr);
71
72#define music_styles_iterate(_p) \
73{ \
74 int _i_; \
75 for (_i_ = 0; _i_ < game.control.num_music_styles; _i_++) { \
76 struct music_style *_p = music_style_by_number(_i_); \
77 if (_p != NULL) {
78
79#define music_styles_iterate_end \
80 } \
81 } \
82}
83
84/* Deletion of music styles not supported */
85#define music_styles_re_active_iterate(_p) \
86 music_styles_iterate(_p)
87
88#define music_styles_re_active_iterate_end \
89 music_styles_iterate_end;
90
91int style_of_city(const struct city *pcity);
92
94
95int city_style(struct city *pcity);
96
97#ifdef __cplusplus
98}
99#endif /* __cplusplus */
100
101#endif /* FC__STYLE_H */
char * incite_cost
Definition comments.c:76
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:66
const char * name
Definition inputfile.c:127
Definition city.h:317
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 city_style(struct city *pcity)
Definition style.c:241
void styles_free(void)
Definition style.c:51
struct nation_style * style_by_rule_name(const char *name)
Definition style.c:117
struct nation_style * style_by_number(int id)
Definition style.c:88
const char * style_name_translation(const struct nation_style *pstyle)
Definition style.c:99
struct music_style * player_music_style(struct player *plr)
Definition style.c:185
void styles_alloc(int count)
Definition style.c:36
int music_style_number(const struct music_style *pms)
Definition style.c:161
int style_of_city(const struct city *pcity)
Definition style.c:202
struct music_style * music_style_by_number(int id)
Definition style.c:171
const char * style_rule_name(const struct nation_style *pstyle)
Definition style.c:108
int style_number(const struct nation_style *pstyle)
Definition style.c:68
void music_styles_free(void)
Definition style.c:148
void music_styles_alloc(int count)
Definition style.c:133
int style_count(void)
Definition style.c:60
int style_index(const struct nation_style *pstyle)
Definition style.c:78
int basic_city_style_for_style(struct nation_style *pstyle)
Definition style.c:210