Freeciv-3.2
Loading...
Searching...
No Matches
achievements.h
Go to the documentation of this file.
1/***********************************************************************
2 Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
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#ifndef FC__ACHIEVEMENTS_H
14#define FC__ACHIEVEMENTS_H
15
16#ifdef __cplusplus
17extern "C" {
18#endif /* __cplusplus */
19
20/* common */
21#include "fc_types.h"
22#include "name_translation.h"
23#include "player.h"
24
26{
27 int id;
31 int value;
32 bool unique;
34 struct player *first;
36
37 /* Messages at server side only */
38 char *first_msg;
39 char *cons_msg;
40};
41
42void achievements_init(void);
43void achievements_free(void);
44
45int achievement_index(const struct achievement *pach);
46int achievement_number(const struct achievement *pach);
48
50const char *achievement_rule_name(struct achievement *pach);
51struct achievement *achievement_by_rule_name(const char *name);
52
53struct player *achievement_plr(struct achievement *ach,
54 struct player_list *achievers);
55bool achievement_check(struct achievement *ach, struct player *pplayer);
56
57const char *achievement_first_msg(struct achievement *pach);
58const char *achievement_later_msg(struct achievement *pach);
59
60bool achievement_player_has(const struct achievement *pach,
61 const struct player *pplayer);
62bool achievement_claimed(const struct achievement *pach);
63
64#define achievements_iterate(_ach_) \
65{ \
66 int _i_; \
67 for (_i_ = 0; _i_ < game.control.num_achievement_types; _i_++) { \
68 struct achievement *_ach_ = achievement_by_number(_i_);
69
70#define achievements_iterate_end \
71 } \
72}
73
74#define achievements_re_active_iterate(_p) \
75 achievements_iterate(_p) { \
76 if (!_p->ruledit_disabled) {
77
78#define achievements_re_active_iterate_end \
79 } \
80 } achievements_iterate_end;
81
82
83int get_literacy(const struct player *pplayer);
84
85#ifdef __cplusplus
86}
87#endif /* __cplusplus */
88
89#endif /* FC__ACHIEVEMENTS_H */
bool achievement_check(struct achievement *ach, struct player *pplayer)
void achievements_free(void)
bool achievement_player_has(const struct achievement *pach, const struct player *pplayer)
int achievement_index(const struct achievement *pach)
struct player * achievement_plr(struct achievement *ach, struct player_list *achievers)
struct achievement * achievement_by_number(int id)
int get_literacy(const struct player *pplayer)
const char * achievement_later_msg(struct achievement *pach)
int achievement_number(const struct achievement *pach)
const char * achievement_first_msg(struct achievement *pach)
const char * achievement_rule_name(struct achievement *pach)
struct achievement * achievement_by_rule_name(const char *name)
const char * achievement_name_translation(struct achievement *pach)
void achievements_init(void)
bool achievement_claimed(const struct achievement *pach)
char * incite_cost
Definition comments.c:75
const char * name
Definition inputfile.c:127
char * first_msg
enum achievement_type type
struct player * first
bv_player achievers
char * cons_msg
struct name_translation name
bool ruledit_disabled