Freeciv-3.1: /fast/freeciv/nightly/S3_1/common/style.h Source File

Freeciv-3.1

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
21 struct nation_style
22{
23 int id;
24 struct name_translation name;
25 bool ruledit_disabled;
26};
27
28 struct music_style
29{
30 int id;
31 char music_peaceful[MAX_LEN_NAME];
32 char music_combat[MAX_LEN_NAME];
33 struct requirement_vector reqs;
34};
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);
68struct music_style *music_style_by_number(int id);
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
93int basic_city_style_for_style(struct nation_style *pstyle);
94
95int city_style(struct city *pcity);
96
97#ifdef __cplusplus
98}
99#endif /* __cplusplus */
100
101#endif /* FC__STYLE_H */
MAX_LEN_NAME
#define MAX_LEN_NAME
Definition fc_types.h:66
name
const char * name
Definition inputfile.c:127
city
Definition city.h:309
music_style
Definition style.h:29
music_style::reqs
struct requirement_vector reqs
Definition style.h:33
music_style::music_peaceful
char music_peaceful[MAX_LEN_NAME]
Definition style.h:31
music_style::music_combat
char music_combat[MAX_LEN_NAME]
Definition style.h:32
music_style::id
int id
Definition style.h:30
name_translation
Definition name_translation.h:35
nation_style
Definition style.h:22
nation_style::name
struct name_translation name
Definition style.h:24
nation_style::id
int id
Definition style.h:23
nation_style::ruledit_disabled
bool ruledit_disabled
Definition style.h:25
player
Definition player.h:249
city_style
int city_style(struct city *pcity)
Definition style.c:241
styles_free
void styles_free(void)
Definition style.c:51
style_by_rule_name
struct nation_style * style_by_rule_name(const char *name)
Definition style.c:117
style_by_number
struct nation_style * style_by_number(int id)
Definition style.c:88
style_name_translation
const char * style_name_translation(const struct nation_style *pstyle)
Definition style.c:99
player_music_style
struct music_style * player_music_style(struct player *plr)
Definition style.c:185
styles_alloc
void styles_alloc(int count)
Definition style.c:36
music_style_number
int music_style_number(const struct music_style *pms)
Definition style.c:161
style_of_city
int style_of_city(const struct city *pcity)
Definition style.c:202
music_style_by_number
struct music_style * music_style_by_number(int id)
Definition style.c:171
style_rule_name
const char * style_rule_name(const struct nation_style *pstyle)
Definition style.c:108
style_number
int style_number(const struct nation_style *pstyle)
Definition style.c:68
music_styles_free
void music_styles_free(void)
Definition style.c:148
music_styles_alloc
void music_styles_alloc(int count)
Definition style.c:133
style_count
int style_count(void)
Definition style.c:60
style_index
int style_index(const struct nation_style *pstyle)
Definition style.c:78
basic_city_style_for_style
int basic_city_style_for_style(struct nation_style *pstyle)
Definition style.c:210