Freeciv-3.3
Loading...
Searching...
No Matches
base.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__BASE_H
14#define FC__BASE_H
15
16#ifdef __cplusplus
17extern "C" {
18#endif /* __cplusplus */
19
20/* utility */
21#include "bitvector.h"
22
23/* common */
24#include "fc_types.h"
25#include "requirements.h"
26
27struct strvec; /* Actually defined in "utility/string_vector.h". */
28
29/* Used in the network protocol. */
30#define SPECENUM_NAME base_gui_type
31#define SPECENUM_VALUE0 BASE_GUI_FORTRESS
32#define SPECENUM_VALUE0NAME "Fortress"
33#define SPECENUM_VALUE1 BASE_GUI_AIRBASE
34#define SPECENUM_VALUE1NAME "Airbase"
35#define SPECENUM_VALUE2 BASE_GUI_OTHER
36#define SPECENUM_VALUE2NAME "Other"
37#include "specenum_gen.h"
38
39struct extra_type;
40
51
52#define BASE_NONE -1
53
54/* General base accessor functions. */
57
58struct base_type *base_by_number(const Base_type_id id);
59
60struct extra_type *base_extra_get(const struct base_type *pbase);
61
62/* Ancillary functions */
63bool can_build_base(const struct unit *punit, const struct base_type *pbase,
64 const struct tile *ptile);
65bool player_can_build_base(const struct base_type *pbase,
66 const struct player *pplayer,
67 const struct tile *ptile);
68
70 const struct unit *punit,
71 const struct tile *ptile);
72
73bool territory_claiming_base(const struct base_type *pbase);
74
75/* Initialization and iteration */
76void base_type_init(struct extra_type *pextra, int idx);
77void base_types_free(void);
78
79#ifdef __cplusplus
80}
81#endif /* __cplusplus */
82
83#endif /* FC__BASE_H */
Base_type_id base_number(const struct base_type *pbase)
Definition base.c:96
void base_type_init(struct extra_type *pextra, int idx)
Definition base.c:121
void base_types_free(void)
Definition base.c:136
bool player_can_build_base(const struct base_type *pbase, const struct player *pplayer, const struct tile *ptile)
Definition base.c:30
Base_type_id base_count(void)
Definition base.c:113
struct extra_type * base_extra_get(const struct base_type *pbase)
Definition base.c:105
struct base_type * get_base_by_gui_type(enum base_gui_type type, const struct unit *punit, const struct tile *ptile)
Definition base.c:143
bool can_build_base(const struct unit *punit, const struct base_type *pbase, const struct tile *ptile)
Definition base.c:55
struct base_type * base_by_number(const Base_type_id id)
Definition base.c:80
bool territory_claiming_base(const struct base_type *pbase)
Definition base.c:162
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 * punit
Definition dialogs_g.h:74
int Base_type_id
Definition fc_types.h:242
GType type
Definition repodlgs.c:1313
int border_sq
Definition base.h:44
int vision_main_sq
Definition base.h:45
enum base_gui_type gui_type
Definition base.h:43
struct extra_type * self
Definition base.h:49
int vision_invis_sq
Definition base.h:46
Base_type_id item_number
Definition base.h:42
int vision_subs_sq
Definition base.h:47
Definition tile.h:50
Definition unit.h:140