2 * Empire - A multi-player, client/server Internet based war game.
3 * Copyright (C) 1986-2000, Dave Pare, Jeff Bailey, Thomas Ruschak,
4 * Ken Stevens, Steve McClure
6 * This program 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 2 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, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 * See the "LEGAL", "LICENSE", "CREDITS" and "README" files for all the
23 * related information and legal notices. It is expected that any future
24 * projects/authors will amend these files as needed.
28 * snxtit_subs.c: arrange item selection using one of many criteria.
30 * Known contributors to this file:
43 snxtitem_area(register struct nstr_item *np, int type, struct range *range)
45 bzero((s_char *)np, sizeof(*np));
52 np->flags = ef_flags(type);
53 xysize_range(&np->range);
58 snxtitem_dist(register struct nstr_item *np, int type, int cx, int cy,
63 bzero((s_char *)np, sizeof(*np));
64 xydist_range(cx, cy, dist, &range);
74 np->flags = ef_flags(type);
76 /* This is no longer proper. */
77 /* It did the wrong thing for small, hitech worlds. */
78 xysize_range(&np->range);
84 snxtitem_xy(register struct nstr_item *np, int type, coord x, coord y)
86 bzero((s_char *)np, sizeof(*np));
95 np->flags = ef_flags(type);
100 snxtitem_all(register struct nstr_item *np, int type)
102 bzero((s_char *)np, sizeof(*np));
108 np->flags = ef_flags(type);
109 xysize_range(&np->range);
114 snxtitem_group(register struct nstr_item *np, int type, s_char group)
118 bzero((s_char *)np, sizeof(*np));
125 np->flags = ef_flags(type);
126 xysize_range(&np->range);
131 snxtitem_rewind(struct nstr_item *np)
135 ef_zapcache(np->type);
139 snxtitem_list(register struct nstr_item *np, int type, int *list, int len)
143 bzero((s_char *)np, sizeof(*np));
149 np->flags = ef_flags(type);
150 if (len <= 0 || len > NS_LSIZE)
152 for (i = 0; i < len; i++)
153 np->list[i] = list[i];