Freeciv-3.3
Loading...
Searching...
No Matches
specialist.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__SPECIALIST_H
15#define FC__SPECIALIST_H
16
17#ifdef __cplusplus
18extern "C" {
19#endif /* __cplusplus */
20
21/* utility */
22#include "shared.h"
23
24/* common */
25#include "fc_types.h"
26#include "name_translation.h"
27#include "requirements.h"
28
42
43#define DEFAULT_SPECIALIST default_specialist
44
45extern struct specialist specialists[SP_MAX];
46extern int default_specialist;
47
48/* General specialist accessor functions. */
52
54struct specialist *specialist_by_rule_name(const char *name);
56
57const char *specialist_rule_name(const struct specialist *sp);
58const char *specialist_plural_translation(const struct specialist *sp);
59const char *specialist_abbreviation_translation(const struct specialist *sp);
60
61/* Ancillary routines */
62const char *specialists_abbreviation_string(void);
64
65int get_specialist_output(const struct city *pcity,
67
68/* Initialization and iteration */
69void specialists_init(void);
70void specialists_free(void);
71
72/* usually an index to arrays */
73#define specialist_type_iterate(sp) \
74{ \
75 Specialist_type_id sp; \
76 \
77 for (sp = 0; sp < specialist_count(); sp++) {
78
79#define specialist_type_iterate_end \
80 } \
81}
82
83#define specialist_type_re_active_iterate(_p) \
84 specialist_type_iterate(_p##_) { \
85 struct specialist *_p = specialist_by_number(_p##_); \
86 if (!_p->ruledit_disabled) {
87
88#define specialist_type_re_active_iterate_end \
89 } \
90 } specialist_type_iterate_end;
91
92#ifdef __cplusplus
93}
94#endif /* __cplusplus */
95
96#endif /* FC__SPECIALIST_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
unsigned char citizens
Definition fc_types.h:247
#define SP_MAX
Definition fc_types.h:267
int Specialist_type_id
Definition fc_types.h:234
#define MAX_LEN_NAME
Definition fc_types.h:66
enum output_type_id Output_type_id
Definition fc_types.h:237
const char * name
Definition inputfile.c:127
struct specialist specialists[SP_MAX]
Definition specialist.c:30
const char * specialists_abbreviation_string(void)
Definition specialist.c:174
struct specialist * specialist_by_rule_name(const char *name)
Definition specialist.c:112
struct specialist * specialist_by_number(const Specialist_type_id id)
Definition specialist.c:100
Specialist_type_id specialist_index(const struct specialist *sp)
Definition specialist.c:82
Specialist_type_id specialist_number(const struct specialist *sp)
Definition specialist.c:91
const char * specialist_rule_name(const struct specialist *sp)
Definition specialist.c:146
int default_specialist
Definition specialist.c:31
const char * specialist_plural_translation(const struct specialist *sp)
Definition specialist.c:155
void specialists_free(void)
Definition specialist.c:53
Specialist_type_id specialist_count(void)
Definition specialist.c:71
const char * specialist_abbreviation_translation(const struct specialist *sp)
Definition specialist.c:164
void specialists_init(void)
Definition specialist.c:36
const char * specialists_string(const citizens *specialist_list)
Definition specialist.c:199
struct specialist * specialist_by_translated_name(const char *name)
Definition specialist.c:130
int get_specialist_output(const struct city *pcity, Specialist_type_id sp, Output_type_id otype)
Definition specialist.c:217
Definition city.h:317
int item_number
Definition specialist.h:30
struct requirement_vector reqs
Definition specialist.h:38
char graphic_alt[MAX_LEN_NAME]
Definition specialist.h:36
bool ruledit_disabled
Definition specialist.h:33
struct strvec * helptext
Definition specialist.h:40
char graphic_str[MAX_LEN_NAME]
Definition specialist.h:35
struct name_translation name
Definition specialist.h:31
struct name_translation abbreviation
Definition specialist.h:32