Freeciv-3.2: /fast/freeciv/nightly/S3_2/common/idex.h Source File

Freeciv-3.2

Loading...
Searching...
No Matches
idex.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__IDEX_H
14#define FC__IDEX_H
15
16#ifdef __cplusplus
17extern "C" {
18#endif /* __cplusplus */
19
20/**************************************************************************
21 idex = ident index: a lookup table for quick mapping of unit and city
22 id values to unit and city pointers.
23***************************************************************************/
24
25/* common */
26#include "fc_types.h"
27
28struct world;
29
30void idex_init(struct world *iworld);
31void idex_free(struct world *iworld);
32
33void idex_register_city(struct world *iworld, struct city *pcity);
34void idex_register_unit(struct world *iworld, struct unit *punit);
35
36void idex_unregister_city(struct world *iworld, struct city *pcity);
37void idex_unregister_unit(struct world *iworld, struct unit *punit);
38
39struct city *idex_lookup_city(struct world *iworld, int id);
40struct unit *idex_lookup_unit(struct world *iworld, int id);
41
42#ifdef __cplusplus
43}
44#endif /* __cplusplus */
45
46#endif /* FC__IDEX_H */
incite_cost
char * incite_cost
Definition comments.c:74
punit
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
fc_types.h
idex_free
void idex_free(struct world *iworld)
Definition idex.c:54
idex_register_unit
void idex_register_unit(struct world *iworld, struct unit *punit)
Definition idex.c:82
idex_lookup_city
struct city * idex_lookup_city(struct world *iworld, int id)
Definition idex.c:133
idex_unregister_city
void idex_unregister_city(struct world *iworld, struct city *pcity)
Definition idex.c:97
idex_init
void idex_init(struct world *iworld)
Definition idex.c:45
idex_lookup_unit
struct unit * idex_lookup_unit(struct world *iworld, int id)
Definition idex.c:146
idex_unregister_unit
void idex_unregister_unit(struct world *iworld, struct unit *punit)
Definition idex.c:115
idex_register_city
void idex_register_city(struct world *iworld, struct city *pcity)
Definition idex.c:67
city
Definition city.h:320
unit
Definition unit.h:138
world
Definition world_object.h:37