2 * Empire - A multi-player, client/server Internet based war game.
3 * Copyright (C) 1986-2011, Dave Pare, Jeff Bailey, Thomas Ruschak,
4 * Ken Stevens, Steve McClure, Markus Armbruster
6 * Empire is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
21 * See files README, COPYING and CREDITS in the root of the source
22 * tree for related information and legal notices. It is expected
23 * that future projects/authors will amend these files as needed.
27 * empobj.h: General empire objects.
29 * Known contributors to this file:
30 * Ron Koenderink, 2006
31 * Markus Armbruster, 2006-2008
37 #include "commodity.h"
53 * initial part must match struct emptypedstr
54 * valid if EFF_TYPED is set in table's flags
58 unsigned generation: 12;
61 /* end of part matching struct emptypedstr */
62 natid own; /* valid if EFF_OWNER is in table's flags */
63 coord x; /* valid if EFF_XY is in table's flags */
64 coord y; /* valid if EFF_XY is in table's flags */
65 /* remaining are valid for sectors and units */
70 /* remaining are valid for units */
72 char group; /* valid if EFF_GROUP is in table's flags */
78 union empobj_storage {
88 struct realmstr realm;
97 #define get_empobj(type, n, p) ef_read((type), (n), (p))
98 #define put_empobj(type, n, p) ef_write((type), (n), (p))
99 #define get_empobjp(type, n) ((struct empobj *)ef_ptr((type), (n)))
101 extern char *obj_nameof(struct empobj *gp);
102 extern struct empobj_chr *get_empobj_chr(struct empobj *gp);
103 extern char *empobj_chr_name(struct empobj *gp);
104 extern int get_empobj_mob_max(int type);